﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="DsIDebitos" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="1" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection ConnectionStringObject="Data Source=PC-ALONGO2\SQLEXPRESS;Initial Catalog=reports;Integrated Security=True" IsAppSettingsProperty="false" Modifier="Assembly" Name="Connection" ParameterPrefix="@" Provider="System.Data.SqlClient" />
          <Connection AppSettingsObjectName="MySettings" AppSettingsPropertyName="SamecaGestConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="SamecaGestConnectionString (MySettings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.SamecaGestV2.My.MySettings.GlobalReference.Default.SamecaGestConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RIdebitosTableAdapter" GeneratorDataComponentClassName="RIdebitosTableAdapter" Name="RIDebitos" UserDataComponentName="RIdebitosTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="FillIDebitos" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="FillIDebitos" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="FillIDebitos">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], tblPaymentTerms.Code AS MdPagamentCode, 
                         tblPaymentTerms.Description AS MdPagammentoDesc, tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, 
                         tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, 
                         DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, 
                         CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                          END AS VALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                         &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                          END ELSE 0 END AS NVENC, DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, 
                         CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                          END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], 
                         { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                         &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                          END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, 
                         tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                         &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                          END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, 
                         tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                         &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                          END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, 
                         tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                         &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                          END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, 
                         tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                         &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                          END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                         &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                          END ELSE '0' END AS DM120, tblCustomerLedgerEntry.[Customer Posting Group]
FROM            tblCustomer LEFT OUTER JOIN
                         tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN
                         tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN
                         tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_]
WHERE        (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="No_" DataSetColumn="No_" />
              <Mapping SourceColumn="Search Name" DataSetColumn="Search Name" />
              <Mapping SourceColumn="MdPagamentCode" DataSetColumn="MdPagamentCode" />
              <Mapping SourceColumn="MdPagammentoDesc" DataSetColumn="MdPagammentoDesc" />
              <Mapping SourceColumn="VendedorCode" DataSetColumn="VendedorCode" />
              <Mapping SourceColumn="VendedorDesc" DataSetColumn="VendedorDesc" />
              <Mapping SourceColumn="Document No_" DataSetColumn="Document No_" />
              <Mapping SourceColumn="Datadoc" DataSetColumn="Datadoc" />
              <Mapping SourceColumn="DataVencimento" DataSetColumn="DataVencimento" />
              <Mapping SourceColumn="DIAS" DataSetColumn="DIAS" />
              <Mapping SourceColumn="VALOR" DataSetColumn="VALOR" />
              <Mapping SourceColumn="NVENC" DataSetColumn="NVENC" />
              <Mapping SourceColumn="DIASDOC" DataSetColumn="DIASDOC" />
              <Mapping SourceColumn="DIAVALOR" DataSetColumn="DIAVALOR" />
              <Mapping SourceColumn="D30" DataSetColumn="D30" />
              <Mapping SourceColumn="D45" DataSetColumn="D45" />
              <Mapping SourceColumn="D60" DataSetColumn="D60" />
              <Mapping SourceColumn="D90" DataSetColumn="D90" />
              <Mapping SourceColumn="D120" DataSetColumn="D120" />
              <Mapping SourceColumn="DM120" DataSetColumn="DM120" />
              <Mapping SourceColumn="Customer Posting Group" DataSetColumn="Customer Posting Group" />
              <Mapping SourceColumn="Customer No_" DataSetColumn="Customer No_" />
            </Mappings>
            <Sources>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="SELECT tblCustomer.No_, tblCustomer.[Search Name], tblCustomer.[Credit Limit (LCY)], tblCustomer.[COSEC Plafond], tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120 FROM tblCustomer INNER JOIN tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code INNER JOIN tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code INNER JOIN tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_]" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="FillByIDebitosGeral" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataBy" GeneratorSourceName="FillByIDebitosGeral" GetMethodModifier="Public" GetMethodName="GetDataBy" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="FillByIDebitosGeral">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        No_, [Search Name], [Credit Limit (LCY)], [COSEC Plafond], MdPagammentoDesc, SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, 
                         SUM(D45) AS D45, SUM(D60) AS D60, SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) / NULLIF (SUM(VALOR), 0) 
                         AS MDA
FROM            (SELECT        tblCustomer.No_, tblCustomer.[Search Name], tblCustomer.[Credit Limit (LCY)], tblCustomer.[COSEC Plafond], 
                                                    tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, tblSalesperson.Code AS VendedorCode, 
                                                    tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Posting Date] AS Datadoc, 
                                                    tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, 
                                                    CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                     END AS VALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                    &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE
                                                     tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], 
                                                    { fn NOW() }) AS DIASDOC, 
                                                    CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                     END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, 
                                                    tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                    &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                     ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, 
                                                    tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                    &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                     ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, 
                                                    tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                    &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                     ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, 
                                                    tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                    &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                     ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, 
                                                    tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                    &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / -
                                                     1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, 
                                                    tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                    &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / -
                                                     1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120
                          FROM            tblCustomer INNER JOIN
                                                    tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code INNER JOIN
                                                    tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code INNER JOIN
                                                    tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_]) AS IDebitos
GROUP BY No_, [Search Name], [Credit Limit (LCY)], [COSEC Plafond], MdPagammentoDesc</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </Sources>
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RIDebitosGLOBALTableAdapter" GeneratorDataComponentClassName="RIDebitosGLOBALTableAdapter" Name="RIDebitosGLOBAL" UserDataComponentName="RIDebitosGLOBALTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="SELECT No_, [Customer Posting Group], SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, SUM(D45) AS D45, SUM(D60) AS D60, SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) AS DIAVALOR, [Search Name], MdPagammentoDesc, VendedorDesc FROM (SELECT tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120, tblCustomerLedgerEntry.[Customer Posting Group] FROM tblCustomer LEFT OUTER JOIN tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_] WHERE (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')) AS IDebitos GROUP BY [Customer Posting Group], No_, [Search Name], MdPagammentoDesc, VendedorDesc" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        IDebitosAgrupado.No_, SUM(IDebitosAgrupado.NVENC) AS NVENC, SUM(IDebitosAgrupado.VALOR) AS VALOR, SUM(IDebitosAgrupado.D30) AS D30, 
                         SUM(IDebitosAgrupado.DM120) AS DM120, SUM(IDebitosAgrupado.D120) AS D120, SUM(IDebitosAgrupado.D90) AS D90, SUM(IDebitosAgrupado.D60) 
                         AS D60, SUM(IDebitosAgrupado.D45) AS D45, SUM(IDebitosAgrupado.DIAVALOR) AS DIAVALOR, SUM(tblCustomer_1.[Credit Limit (LCY)]) AS CRDINT, 
                         SUM(tblCustomer_1.[COSEC Plafond]) AS COSEC, IDebitosAgrupado.[Search Name], IDebitosAgrupado.MdPagammentoDesc, 
                         IDebitosAgrupado.VendedorDesc
FROM            (SELECT        No_, [Customer Posting Group], SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, SUM(D45) AS D45, SUM(D60) AS D60, 
                                                    SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) AS DIAVALOR, [Search Name], MdPagammentoDesc, 
                                                    VendedorDesc
                          FROM            (SELECT        tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], 
                                                                              tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, 
                                                                              tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], 
                                                                              tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], 
                                                                              { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120, 
                                                                              tblCustomerLedgerEntry.[Customer Posting Group]
                                                    FROM            tblCustomer LEFT OUTER JOIN
                                                                              tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN
                                                                              tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN
                                                                              tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_]
                                                    WHERE        (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND 
                                                                              (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')) AS IDebitos
                          GROUP BY [Customer Posting Group], No_, [Search Name], MdPagammentoDesc, VendedorDesc) AS IDebitosAgrupado INNER JOIN
                         tblCustomer AS tblCustomer_1 ON IDebitosAgrupado.No_ = tblCustomer_1.No_
GROUP BY IDebitosAgrupado.No_, IDebitosAgrupado.[Search Name], IDebitosAgrupado.MdPagammentoDesc, IDebitosAgrupado.VendedorDesc</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="No_" DataSetColumn="No_" />
              <Mapping SourceColumn="Search Name" DataSetColumn="Search Name" />
              <Mapping SourceColumn="MdPagammentoDesc" DataSetColumn="MdPagammentoDesc" />
              <Mapping SourceColumn="NVENC" DataSetColumn="NVENC" />
              <Mapping SourceColumn="VALOR" DataSetColumn="VALOR" />
              <Mapping SourceColumn="D30" DataSetColumn="D30" />
              <Mapping SourceColumn="D45" DataSetColumn="D45" />
              <Mapping SourceColumn="D60" DataSetColumn="D60" />
              <Mapping SourceColumn="D90" DataSetColumn="D90" />
              <Mapping SourceColumn="D120" DataSetColumn="D120" />
              <Mapping SourceColumn="DM120" DataSetColumn="DM120" />
              <Mapping SourceColumn="DIAVALOR" DataSetColumn="DIAVALOR" />
              <Mapping SourceColumn="CRDINT" DataSetColumn="CRDINT" />
              <Mapping SourceColumn="COSEC" DataSetColumn="COSEC" />
              <Mapping SourceColumn="VendedorDesc" DataSetColumn="VendedorDesc" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RIDebitosVendedorTableAdapter" GeneratorDataComponentClassName="RIDebitosVendedorTableAdapter" Name="RIDebitosVendedor" UserDataComponentName="RIDebitosVendedorTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="SELECT No_, [Customer Posting Group], SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, SUM(D45) AS D45, SUM(D60) AS D60, SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) AS DIAVALOR, [Search Name], MdPagammentoDesc, VendedorDesc FROM (SELECT tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120, tblCustomerLedgerEntry.[Customer Posting Group] FROM tblCustomer LEFT OUTER JOIN tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_] WHERE (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')) AS IDebitos GROUP BY [Customer Posting Group], No_, [Search Name], MdPagammentoDesc, VendedorDesc" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        IDebitosAgrupado.No_, SUM(IDebitosAgrupado.NVENC) AS NVENC, SUM(IDebitosAgrupado.VALOR) AS VALOR, SUM(IDebitosAgrupado.D30) AS D30, 
                         SUM(IDebitosAgrupado.DM120) AS DM120, SUM(IDebitosAgrupado.D120) AS D120, SUM(IDebitosAgrupado.D90) AS D90, SUM(IDebitosAgrupado.D60) 
                         AS D60, SUM(IDebitosAgrupado.D45) AS D45, SUM(IDebitosAgrupado.DIAVALOR) AS DIAVALOR, SUM(tblCustomer_1.[Credit Limit (LCY)]) AS CRDINT, 
                         SUM(tblCustomer_1.[COSEC Plafond]) AS COSEC, IDebitosAgrupado.[Search Name], IDebitosAgrupado.MdPagammentoDesc, 
                         IDebitosAgrupado.VendedorDesc
FROM            (SELECT        No_, [Customer Posting Group], SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, SUM(D45) AS D45, SUM(D60) AS D60, 
                                                    SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) AS DIAVALOR, [Search Name], MdPagammentoDesc, 
                                                    VendedorDesc
                          FROM            (SELECT        tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], 
                                                                              tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, 
                                                                              tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], 
                                                                              tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], 
                                                                              { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120, 
                                                                              tblCustomerLedgerEntry.[Customer Posting Group]
                                                    FROM            tblCustomer LEFT OUTER JOIN
                                                                              tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN
                                                                              tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN
                                                                              tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_]
                                                    WHERE        (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND 
                                                                              (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')) AS IDebitos
                          GROUP BY [Customer Posting Group], No_, [Search Name], MdPagammentoDesc, VendedorDesc) AS IDebitosAgrupado INNER JOIN
                         tblCustomer AS tblCustomer_1 ON IDebitosAgrupado.No_ = tblCustomer_1.No_
GROUP BY IDebitosAgrupado.No_, IDebitosAgrupado.[Search Name], IDebitosAgrupado.MdPagammentoDesc, IDebitosAgrupado.VendedorDesc</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="VendedorDesc" DataSetColumn="VendedorDesc" />
              <Mapping SourceColumn="No_" DataSetColumn="No_" />
              <Mapping SourceColumn="Search Name" DataSetColumn="Search Name" />
              <Mapping SourceColumn="CRDINT" DataSetColumn="CRDINT" />
              <Mapping SourceColumn="COSEC" DataSetColumn="COSEC" />
              <Mapping SourceColumn="VALOR" DataSetColumn="VALOR" />
              <Mapping SourceColumn="NVENC" DataSetColumn="NVENC" />
              <Mapping SourceColumn="DIAVALOR" DataSetColumn="DIAVALOR" />
              <Mapping SourceColumn="D30" DataSetColumn="D30" />
              <Mapping SourceColumn="D45" DataSetColumn="D45" />
              <Mapping SourceColumn="D60" DataSetColumn="D60" />
              <Mapping SourceColumn="D90" DataSetColumn="D90" />
              <Mapping SourceColumn="D120" DataSetColumn="D120" />
              <Mapping SourceColumn="DM120" DataSetColumn="DM120" />
              <Mapping SourceColumn="MdPagammentoDesc" DataSetColumn="MdPagammentoDesc" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RIDebitosVendedorDetalhadoTableAdapter" GeneratorDataComponentClassName="RIDebitosVendedorDetalhadoTableAdapter" Name="RIDebitosVendedorDetalhado" UserDataComponentName="RIDebitosVendedorDetalhadoTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        IDebitosAgrupado.No_, SUM(IDebitosAgrupado.NVENC) AS NVENC, SUM(IDebitosAgrupado.VALOR) AS VALOR, SUM(IDebitosAgrupado.D30) AS D30, 
                         SUM(IDebitosAgrupado.DM120) AS DM120, SUM(IDebitosAgrupado.D120) AS D120, SUM(IDebitosAgrupado.D90) AS D90, SUM(IDebitosAgrupado.D60) 
                         AS D60, SUM(IDebitosAgrupado.D45) AS D45, SUM(IDebitosAgrupado.DIAVALOR) AS DIAVALOR, SUM(tblCustomer_1.[Credit Limit (LCY)]) AS CRDINT, 
                         SUM(tblCustomer_1.[COSEC Plafond]) AS COSEC, IDebitosAgrupado.[Search Name], IDebitosAgrupado.VendedorDesc, IDebitosAgrupado.[Document No_], 
                         IDebitosAgrupado.Datadoc, IDebitosAgrupado.DataVencimento, tblCustomer_1.Blocked
FROM            (SELECT        No_, [Customer Posting Group], SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, SUM(D45) AS D45, SUM(D60) AS D60, 
                                                    SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) AS DIAVALOR, [Search Name], VendedorDesc, 
                                                    [Document No_], Datadoc, DataVencimento
                          FROM            (SELECT        tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], 
                                                                              tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, 
                                                                              tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], 
                                                                              tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], 
                                                                              { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120, 
                                                                              tblCustomerLedgerEntry.[Customer Posting Group]
                                                    FROM            tblCustomer LEFT OUTER JOIN
                                                                              tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN
                                                                              tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN
                                                                              tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_]
                                                    WHERE        (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND 
                                                                              (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')) AS IDebitos
                          GROUP BY [Customer Posting Group], No_, [Search Name], VendedorDesc, [Document No_], Datadoc, DataVencimento) AS IDebitosAgrupado INNER JOIN
                         tblCustomer AS tblCustomer_1 ON IDebitosAgrupado.No_ = tblCustomer_1.No_
GROUP BY IDebitosAgrupado.No_, IDebitosAgrupado.[Search Name], IDebitosAgrupado.VendedorDesc, IDebitosAgrupado.[Document No_], IDebitosAgrupado.Datadoc, 
                         IDebitosAgrupado.DataVencimento, tblCustomer_1.Blocked
HAVING        (SUM(IDebitosAgrupado.VALOR) &lt;&gt; 0)</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="No_" DataSetColumn="No_" />
              <Mapping SourceColumn="NVENC" DataSetColumn="NVENC" />
              <Mapping SourceColumn="VALOR" DataSetColumn="VALOR" />
              <Mapping SourceColumn="D30" DataSetColumn="D30" />
              <Mapping SourceColumn="DM120" DataSetColumn="DM120" />
              <Mapping SourceColumn="D120" DataSetColumn="D120" />
              <Mapping SourceColumn="D90" DataSetColumn="D90" />
              <Mapping SourceColumn="D60" DataSetColumn="D60" />
              <Mapping SourceColumn="D45" DataSetColumn="D45" />
              <Mapping SourceColumn="DIAVALOR" DataSetColumn="DIAVALOR" />
              <Mapping SourceColumn="CRDINT" DataSetColumn="CRDINT" />
              <Mapping SourceColumn="COSEC" DataSetColumn="COSEC" />
              <Mapping SourceColumn="Search Name" DataSetColumn="Search Name" />
              <Mapping SourceColumn="VendedorDesc" DataSetColumn="VendedorDesc" />
              <Mapping SourceColumn="Document No_" DataSetColumn="Document No_" />
              <Mapping SourceColumn="Datadoc" DataSetColumn="Datadoc" />
              <Mapping SourceColumn="DataVencimento" DataSetColumn="DataVencimento" />
              <Mapping SourceColumn="Blocked" DataSetColumn="Blocked" />
            </Mappings>
            <Sources>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="FillBy" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataBy" GeneratorSourceName="FillBy" GetMethodModifier="Public" GetMethodName="GetDataBy" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="FillBy">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        IDebitosAgrupado.No_, SUM(IDebitosAgrupado.NVENC) AS NVENC, SUM(IDebitosAgrupado.VALOR) AS VALOR, SUM(IDebitosAgrupado.D30) AS D30, 
                         SUM(IDebitosAgrupado.DM120) AS DM120, SUM(IDebitosAgrupado.D120) AS D120, SUM(IDebitosAgrupado.D90) AS D90, SUM(IDebitosAgrupado.D60) 
                         AS D60, SUM(IDebitosAgrupado.D45) AS D45, SUM(IDebitosAgrupado.DIAVALOR) AS DIAVALOR, SUM(tblCustomer_1.[Credit Limit (LCY)]) AS CRDINT, 
                         SUM(tblCustomer_1.[COSEC Plafond]) AS COSEC, IDebitosAgrupado.[Search Name], IDebitosAgrupado.VendedorDesc, IDebitosAgrupado.[Document No_], 
                         IDebitosAgrupado.Datadoc, IDebitosAgrupado.DataVencimento, tblCustomer_1.Blocked
FROM            (SELECT        No_, [Customer Posting Group], SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, SUM(D45) AS D45, SUM(D60) AS D60, 
                                                    SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) AS DIAVALOR, [Search Name], VendedorDesc, 
                                                    [Document No_], Datadoc, DataVencimento
                          FROM            (SELECT        tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], 
                                                                              tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, 
                                                                              tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], 
                                                                              tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], 
                                                                              { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120, 
                                                                              tblCustomerLedgerEntry.[Customer Posting Group]
                                                    FROM            tblCustomer LEFT OUTER JOIN
                                                                              tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN
                                                                              tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN
                                                                              tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_]
                                                    WHERE        (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND 
                                                                              (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')) AS IDebitos
                          GROUP BY [Customer Posting Group], No_, [Search Name], VendedorDesc, [Document No_], Datadoc, DataVencimento) AS IDebitosAgrupado INNER JOIN
                         tblCustomer AS tblCustomer_1 ON IDebitosAgrupado.No_ = tblCustomer_1.No_
GROUP BY IDebitosAgrupado.No_, IDebitosAgrupado.[Search Name], IDebitosAgrupado.VendedorDesc, IDebitosAgrupado.[Document No_], IDebitosAgrupado.Datadoc, 
                         IDebitosAgrupado.DataVencimento, tblCustomer_1.Blocked
HAVING        (SUM(IDebitosAgrupado.VALOR) &lt;&gt; 0) AND (IDebitosAgrupado.VendedorDesc = @vendedor)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="vendedor" ColumnName="VendedorDesc" DataSourceName="SELECT No_, [Customer Posting Group], SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, SUM(D45) AS D45, SUM(D60) AS D60, SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) AS DIAVALOR, [Search Name], VendedorDesc, [Document No_], Datadoc, DataVencimento FROM (SELECT tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120, tblCustomerLedgerEntry.[Customer Posting Group] FROM tblCustomer LEFT OUTER JOIN tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_] WHERE (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')) AS IDebitos GROUP BY [Customer Posting Group], No_, [Search Name], VendedorDesc, [Document No_], Datadoc, DataVencimento" DataTypeServer="unknown" DbType="AnsiString" Direction="Input" ParameterName="@vendedor" Precision="0" Scale="0" Size="1024" SourceColumn="VendedorDesc" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </Sources>
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RLetrasAbertoTableAdapter" GeneratorDataComponentClassName="RLetrasAbertoTableAdapter" Name="RLetrasAberto" UserDataComponentName="RLetrasAbertoTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        tblCustomer.No_, tblCustomer.Company, tblCustomer.[Search Name], tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Bill No_] AS TITULO,
                          tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_], tblCustomerLedgerEntry.[Customer Posting Group], tblCustomerLedgerEntry.[Document Date], 
                         tblCustomerLedgerEntry.[Due Date], tblPostedCarteraDoc.[Bank Account No_], DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                         AS DIAS
FROM            tblPostedCarteraDoc RIGHT OUTER JOIN
                         tblCustomerLedgerEntry ON tblPostedCarteraDoc.No_ = tblCustomerLedgerEntry.[Bill No_] LEFT OUTER JOIN
                         tblClosedCarteraDoc ON tblCustomerLedgerEntry.[Document No_] = tblClosedCarteraDoc.No_ LEFT OUTER JOIN
                         tblCustomer ON tblCustomerLedgerEntry.[Customer No_] = tblCustomer.No_
WHERE        (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &gt; 0) AND (tblCustomerLedgerEntry.[Customer Posting Group] = 'nac-let') AND 
                         (tblCustomerLedgerEntry.[Due Date] &lt;= { fn NOW() }) OR
                         (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &gt; 0) AND (tblCustomerLedgerEntry.[Customer Posting Group] = 'nac-desc') AND 
                         (tblCustomerLedgerEntry.[Due Date] &lt;= { fn NOW() })</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="No_" DataSetColumn="No_" />
              <Mapping SourceColumn="Company" DataSetColumn="Company" />
              <Mapping SourceColumn="Search Name" DataSetColumn="Search Name" />
              <Mapping SourceColumn="Document No_" DataSetColumn="Document No_" />
              <Mapping SourceColumn="TITULO" DataSetColumn="TITULO" />
              <Mapping SourceColumn="Remaining Amount (LCY) stats_" DataSetColumn="Remaining Amount (LCY) stats_" />
              <Mapping SourceColumn="Customer Posting Group" DataSetColumn="Customer Posting Group" />
              <Mapping SourceColumn="Document Date" DataSetColumn="Document Date" />
              <Mapping SourceColumn="Due Date" DataSetColumn="Due Date" />
              <Mapping SourceColumn="Bank Account No_" DataSetColumn="Bank Account No_" />
              <Mapping SourceColumn="DIAS" DataSetColumn="DIAS" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RCoberturaCosecTableAdapter" GeneratorDataComponentClassName="RCoberturaCosecTableAdapter" Name="RCoberturaCosec" UserDataComponentName="RCoberturaCosecTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="SELECT No_, [Customer Posting Group], SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, SUM(D45) AS D45, SUM(D60) AS D60, SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) AS DIAVALOR, [Search Name], MdPagammentoDesc, VendedorDesc FROM (SELECT tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120, tblCustomerLedgerEntry.[Customer Posting Group] FROM tblCustomer LEFT OUTER JOIN tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_] WHERE (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')) AS IDebitos GROUP BY [Customer Posting Group], No_, [Search Name], MdPagammentoDesc, VendedorDesc" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        IDebitosAgrupado.No_, SUM(IDebitosAgrupado.NVENC) AS NVENC, SUM(IDebitosAgrupado.VALOR) AS VALOR, SUM(IDebitosAgrupado.D30) AS D30, 
                         SUM(IDebitosAgrupado.DM120) AS DM120, SUM(IDebitosAgrupado.D120) AS D120, SUM(IDebitosAgrupado.D90) AS D90, SUM(IDebitosAgrupado.D60) 
                         AS D60, SUM(IDebitosAgrupado.D45) AS D45, SUM(IDebitosAgrupado.DIAVALOR) AS DIAVALOR, SUM(tblCustomer_1.[Credit Limit (LCY)]) AS CRDINT, 
                         SUM(tblCustomer_1.[COSEC Plafond]) AS COSEC, IDebitosAgrupado.[Search Name], IDebitosAgrupado.VendedorDesc
FROM            (SELECT        No_, [Customer Posting Group], SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, SUM(D45) AS D45, SUM(D60) AS D60, 
                                                    SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) AS DIAVALOR, [Search Name], MdPagammentoDesc, 
                                                    VendedorDesc
                          FROM            (SELECT        tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], 
                                                                              tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, 
                                                                              tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], 
                                                                              tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], 
                                                                              { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120, 
                                                                              tblCustomerLedgerEntry.[Customer Posting Group]
                                                    FROM            tblCustomer LEFT OUTER JOIN
                                                                              tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN
                                                                              tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN
                                                                              tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_]
                                                    WHERE        (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND 
                                                                              (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')) AS IDebitos
                          GROUP BY [Customer Posting Group], No_, [Search Name], MdPagammentoDesc, VendedorDesc) AS IDebitosAgrupado INNER JOIN
                         tblCustomer AS tblCustomer_1 ON IDebitosAgrupado.No_ = tblCustomer_1.No_
GROUP BY IDebitosAgrupado.No_, IDebitosAgrupado.[Search Name], IDebitosAgrupado.VendedorDesc
HAVING        (SUM(IDebitosAgrupado.VALOR) &gt; 0)</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="No_" DataSetColumn="No_" />
              <Mapping SourceColumn="NVENC" DataSetColumn="NVENC" />
              <Mapping SourceColumn="VALOR" DataSetColumn="VALOR" />
              <Mapping SourceColumn="D30" DataSetColumn="D30" />
              <Mapping SourceColumn="DM120" DataSetColumn="DM120" />
              <Mapping SourceColumn="D120" DataSetColumn="D120" />
              <Mapping SourceColumn="D90" DataSetColumn="D90" />
              <Mapping SourceColumn="D60" DataSetColumn="D60" />
              <Mapping SourceColumn="D45" DataSetColumn="D45" />
              <Mapping SourceColumn="DIAVALOR" DataSetColumn="DIAVALOR" />
              <Mapping SourceColumn="CRDINT" DataSetColumn="CRDINT" />
              <Mapping SourceColumn="COSEC" DataSetColumn="COSEC" />
              <Mapping SourceColumn="Search Name" DataSetColumn="Search Name" />
              <Mapping SourceColumn="VendedorDesc" DataSetColumn="VendedorDesc" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RLetrasParaAceiteTableAdapter" GeneratorDataComponentClassName="RLetrasParaAceiteTableAdapter" Name="RLetrasParaAceite" UserDataComponentName="RLetrasParaAceiteTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        dbo.tblCustomerLedgerEntry.[Customer No_], dbo.tblCarteraDoc.No_, dbo.tblCarteraDoc.[Posting Date], dbo.tblCarteraDoc.[Due Date], 
                         dbo.tblCarteraDoc.Accepted, dbo.tblCarteraDoc.[Remaining Amount], dbo.tblCustomer.[Search Name]
FROM            dbo.tblCarteraDoc INNER JOIN
                         dbo.tblCustomerLedgerEntry ON dbo.tblCarteraDoc.[Account No_] = dbo.tblCustomerLedgerEntry.[Customer No_] INNER JOIN
                         dbo.tblCustomer ON dbo.tblCustomerLedgerEntry.[Customer No_] = dbo.tblCustomer.No_
GROUP BY dbo.tblCustomerLedgerEntry.[Customer No_], dbo.tblCarteraDoc.No_, dbo.tblCarteraDoc.[Posting Date], dbo.tblCarteraDoc.[Due Date], 
                         dbo.tblCarteraDoc.Accepted, dbo.tblCarteraDoc.[Remaining Amount], dbo.tblCustomer.[Search Name], dbo.tblCarteraDoc.[Payment Method Code]
HAVING        (dbo.tblCarteraDoc.Accepted = 2) AND (dbo.tblCarteraDoc.[Payment Method Code] = 'LETRAS')</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Customer No_" DataSetColumn="Customer No_" />
              <Mapping SourceColumn="No_" DataSetColumn="No_" />
              <Mapping SourceColumn="Posting Date" DataSetColumn="Posting Date" />
              <Mapping SourceColumn="Due Date" DataSetColumn="Due Date" />
              <Mapping SourceColumn="Accepted" DataSetColumn="Accepted" />
              <Mapping SourceColumn="Remaining Amount" DataSetColumn="Remaining Amount" />
              <Mapping SourceColumn="Search Name" DataSetColumn="Search Name" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RLetrasCarteiraTableAdapter" GeneratorDataComponentClassName="RLetrasCarteiraTableAdapter" Name="RLetrasCarteira" UserDataComponentName="RLetrasCarteiraTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        dbo.tblCustomerLedgerEntry.[Customer No_], dbo.tblCarteraDoc.[Document No_], dbo.tblCarteraDoc.No_, dbo.tblCarteraDoc.[Posting Date], 
                         dbo.tblCarteraDoc.[Due Date], dbo.tblCarteraDoc.[Remaining Amount], dbo.tblCustomer.[Search Name]
FROM            dbo.tblCustomerLedgerEntry INNER JOIN
                         dbo.tblCarteraDoc ON dbo.tblCustomerLedgerEntry.[Customer No_] = dbo.tblCarteraDoc.[Account No_] INNER JOIN
                         dbo.tblCustomer ON dbo.tblCustomerLedgerEntry.[Customer No_] = dbo.tblCustomer.No_
GROUP BY dbo.tblCustomerLedgerEntry.[Customer No_], dbo.tblCarteraDoc.[Document No_], dbo.tblCarteraDoc.No_, dbo.tblCarteraDoc.[Posting Date], 
                         dbo.tblCarteraDoc.[Due Date], dbo.tblCarteraDoc.[Remaining Amount], dbo.tblCustomer.[Search Name], dbo.tblCarteraDoc.[Payment Method Code]
HAVING        (dbo.tblCarteraDoc.[Payment Method Code] = 'LETRAS')</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Customer No_" DataSetColumn="Customer No_" />
              <Mapping SourceColumn="Document No_" DataSetColumn="Document No_" />
              <Mapping SourceColumn="No_" DataSetColumn="No_" />
              <Mapping SourceColumn="Posting Date" DataSetColumn="Posting Date" />
              <Mapping SourceColumn="Due Date" DataSetColumn="Due Date" />
              <Mapping SourceColumn="Remaining Amount" DataSetColumn="Remaining Amount" />
              <Mapping SourceColumn="Search Name" DataSetColumn="Search Name" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RLetrasClientesTableAdapter" GeneratorDataComponentClassName="RLetrasClientesTableAdapter" Name="RLetrasClientes" UserDataComponentName="RLetrasClientesTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        tblCustomerLedgerEntry1.[Customer No_], tblCustomerLedgerEntry.[Posting Date], tblCustomerLedgerEntry1.[Document No_] AS Letra, 
                         tblCustomerLedgerEntry.[Document No_] AS Factura, tblCustomerLedgerEntry.[Document Type], tblCustomerLedgerEntry.[Due Date] AS VencFactura, 
                         tblCustomerLedgerEntry.[Amount (LCY) stats_], tblCustomer_1.[Search Name], tblPaymentTerms.Code, tblPaymentTerms.Description
FROM            tblCustomerLedgerEntry INNER JOIN
                         tblCustomerLedgerEntry AS tblCustomerLedgerEntry1 ON tblCustomerLedgerEntry.[Closed by Entry No_] = tblCustomerLedgerEntry1.[Entry No_] INNER JOIN
                             (SELECT        tblCustomer.No_, tblCustomer.Company, tblCustomer.[Search Name], tblCustomerLedgerEntry_1.[Document No_], 
                                                         tblCustomerLedgerEntry_1.[Bill No_] AS TITULO, tblCustomerLedgerEntry_1.[Remaining Amount (LCY) stats_], 
                                                         tblCustomerLedgerEntry_1.[Customer Posting Group], tblCustomerLedgerEntry_1.[Document Date], tblCustomerLedgerEntry_1.[Due Date], 
                                                         tblPostedCarteraDoc.[Bank Account No_], DATEDIFF(DAY, tblCustomerLedgerEntry_1.[Due Date], { fn NOW() }) AS DIAS
                               FROM            tblPostedCarteraDoc RIGHT OUTER JOIN
                                                         tblCustomerLedgerEntry AS tblCustomerLedgerEntry_1 ON tblPostedCarteraDoc.No_ = tblCustomerLedgerEntry_1.[Bill No_] LEFT OUTER JOIN
                                                         tblClosedCarteraDoc ON tblCustomerLedgerEntry_1.[Document No_] = tblClosedCarteraDoc.No_ LEFT OUTER JOIN
                                                         tblCustomer ON tblCustomerLedgerEntry_1.[Customer No_] = tblCustomer.No_
                               WHERE        (tblCustomerLedgerEntry_1.[Remaining Amount (LCY) stats_] &gt; 0) AND (tblCustomerLedgerEntry_1.[Customer Posting Group] = 'nac-let') AND 
                                                         (tblCustomerLedgerEntry_1.[Due Date] &lt;= { fn NOW() }) OR
                                                         (tblCustomerLedgerEntry_1.[Remaining Amount (LCY) stats_] &gt; 0) AND (tblCustomerLedgerEntry_1.[Customer Posting Group] = 'nac-desc') AND 
                                                         (tblCustomerLedgerEntry_1.[Due Date] &lt;= { fn NOW() })) AS LtAberto ON 
                         tblCustomerLedgerEntry1.[Document No_] = LtAberto.[Document No_] INNER JOIN
                         tblCustomer AS tblCustomer_1 ON tblCustomerLedgerEntry1.[Customer No_] = tblCustomer_1.No_ INNER JOIN
                         tblPaymentTerms ON tblCustomer_1.[Payment Terms Code] = tblPaymentTerms.Code
WHERE        (tblCustomerLedgerEntry.[Document Type] = 2)</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Customer No_" DataSetColumn="Customer No_" />
              <Mapping SourceColumn="Posting Date" DataSetColumn="Posting Date" />
              <Mapping SourceColumn="Document Type" DataSetColumn="Document Type" />
              <Mapping SourceColumn="Letra" DataSetColumn="Letra" />
              <Mapping SourceColumn="Factura" DataSetColumn="Factura" />
              <Mapping SourceColumn="VencFactura" DataSetColumn="VencFactura" />
              <Mapping SourceColumn="Amount (LCY) stats_" DataSetColumn="Amount (LCY) stats_" />
              <Mapping SourceColumn="Search Name" DataSetColumn="Search Name" />
              <Mapping SourceColumn="Code" DataSetColumn="Code" />
              <Mapping SourceColumn="Description" DataSetColumn="Description" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RLetrasDescontadasTableAdapter" GeneratorDataComponentClassName="RLetrasDescontadasTableAdapter" Name="RLetrasDescontadas" UserDataComponentName="RLetrasDescontadasTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        dbo.tblPostedCarteraDoc.[Account No_], dbo.tblCustomer.[Search Name], dbo.tblPostedCarteraDoc.[Document No_], dbo.tblPostedCarteraDoc.No_, 
                         dbo.tblPostedCarteraDoc.[Posting Date], dbo.tblPostedCarteraDoc.[Due Date], dbo.tblPostedCarteraDoc.[Remaining Amt_ (LCY)], 
                         dbo.tblPostedBillGroup.[Bank Account No_], dbo.tblBankAccount.[Search Name] AS BankDesc
FROM            dbo.tblPostedBillGroup INNER JOIN
                         dbo.tblPostedCarteraDoc ON dbo.tblPostedBillGroup.No_ = dbo.tblPostedCarteraDoc.[Bill Gr__Pmt_ Order No_] INNER JOIN
                         dbo.tblCustomer ON dbo.tblPostedCarteraDoc.[Account No_] = dbo.tblCustomer.No_ INNER JOIN
                         dbo.tblBankAccount ON dbo.tblPostedBillGroup.[Bank Account No_] = dbo.tblBankAccount.No_
GROUP BY dbo.tblPostedCarteraDoc.[Account No_], dbo.tblCustomer.[Search Name], dbo.tblPostedCarteraDoc.[Document No_], dbo.tblPostedCarteraDoc.No_, 
                         dbo.tblPostedCarteraDoc.[Posting Date], dbo.tblPostedCarteraDoc.[Due Date], dbo.tblPostedCarteraDoc.[Remaining Amt_ (LCY)], 
                         dbo.tblPostedBillGroup.[Bank Account No_], dbo.tblBankAccount.[Search Name], dbo.tblPostedCarteraDoc.[Payment Method Code]
HAVING        (dbo.tblPostedCarteraDoc.[Payment Method Code] = 'LETRAS')</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Account No_" DataSetColumn="Account No_" />
              <Mapping SourceColumn="Search Name" DataSetColumn="Search Name" />
              <Mapping SourceColumn="Document No_" DataSetColumn="Document No_" />
              <Mapping SourceColumn="No_" DataSetColumn="No_" />
              <Mapping SourceColumn="Posting Date" DataSetColumn="Posting Date" />
              <Mapping SourceColumn="Due Date" DataSetColumn="Due Date" />
              <Mapping SourceColumn="Remaining Amt_ (LCY)" DataSetColumn="Remaining Amt_ (LCY)" />
              <Mapping SourceColumn="Bank Account No_" DataSetColumn="Bank Account No_" />
              <Mapping SourceColumn="BankDesc" DataSetColumn="BankDesc" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="DashboardTableAdapter" GeneratorDataComponentClassName="DashboardTableAdapter" Name="Dashboard" UserDataComponentName="DashboardTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="SamecaGest.dbo.teste1" DbObjectType="View" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        MesDesc, Mes, CAST(VENCIDO AS DECIMAL(18, 2)) AS VENCIDO, CAST(NVENC AS DECIMAL(18, 2)) AS NVENC, CAST(VALOR AS DECIMAL(18, 2)) 
                         AS VALOR
FROM            teste1</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="NVENC" DataSetColumn="NVENC" />
              <Mapping SourceColumn="VALOR" DataSetColumn="VALOR" />
              <Mapping SourceColumn="VENCIDO" DataSetColumn="VENCIDO" />
              <Mapping SourceColumn="MesDesc" DataSetColumn="MesDesc" />
              <Mapping SourceColumn="Mes" DataSetColumn="Mes" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="dboardIDebitosTableAdapter" GeneratorDataComponentClassName="dboardIDebitosTableAdapter" Name="dboardIDebitos" UserDataComponentName="dboardIDebitosTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        'TOTAL' AS [Customer Posting Group], SUM(IDebitosAgrupado.NVENC) AS NVENC, SUM(IDebitosAgrupado.VALOR) AS VALOR, SUM(IDebitosAgrupado.D30) 
                         AS D30, SUM(IDebitosAgrupado.DM120) AS DM120, SUM(IDebitosAgrupado.D120) AS D120, SUM(IDebitosAgrupado.D90) AS D90, 
                         SUM(IDebitosAgrupado.D60) AS D60, SUM(IDebitosAgrupado.D45) AS D45, SUM(IDebitosAgrupado.DIAVALOR) AS DIAVALOR, 
                         SUM(tblCustomer_1.[Credit Limit (LCY)]) AS CRDINT, SUM(tblCustomer_1.[COSEC Plafond]) AS COSEC
FROM            (SELECT        No_, [Customer Posting Group], SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, SUM(D45) AS D45, SUM(D60) AS D60, 
                                                    SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) AS DIAVALOR
                          FROM            (SELECT        tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], 
                                                                              tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, 
                                                                              tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, tblCustomerLedgerEntry.[Document No_], 
                                                                              tblCustomerLedgerEntry.[Posting Date] AS Datadoc, tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], 
                                                                              { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120, 
                                                                              tblCustomerLedgerEntry.[Customer Posting Group]
                                                    FROM            tblCustomer LEFT OUTER JOIN
                                                                              tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN
                                                                              tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN
                                                                              tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_]
                                                    WHERE        (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND 
                                                                              (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')) AS IDebitos
                          GROUP BY [Customer Posting Group], No_) AS IDebitosAgrupado INNER JOIN
                         tblCustomer AS tblCustomer_1 ON IDebitosAgrupado.No_ = tblCustomer_1.No_</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Customer Posting Group" DataSetColumn="Customer Posting Group" />
              <Mapping SourceColumn="NVENC" DataSetColumn="NVENC" />
              <Mapping SourceColumn="VALOR" DataSetColumn="VALOR" />
              <Mapping SourceColumn="D30" DataSetColumn="D30" />
              <Mapping SourceColumn="DM120" DataSetColumn="DM120" />
              <Mapping SourceColumn="D120" DataSetColumn="D120" />
              <Mapping SourceColumn="D90" DataSetColumn="D90" />
              <Mapping SourceColumn="D60" DataSetColumn="D60" />
              <Mapping SourceColumn="D45" DataSetColumn="D45" />
              <Mapping SourceColumn="DIAVALOR" DataSetColumn="DIAVALOR" />
              <Mapping SourceColumn="CRDINT" DataSetColumn="CRDINT" />
              <Mapping SourceColumn="COSEC" DataSetColumn="COSEC" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="DataTable1TableAdapter" GeneratorDataComponentClassName="DataTable1TableAdapter" Name="DataTable1" UserDataComponentName="DataTable1TableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        Idade, Montante
FROM            (SELECT        SUM(IDebitosAgrupado.NVENC) AS NVENC, SUM(IDebitosAgrupado.VALOR) AS VALOR, SUM(IDebitosAgrupado.D30) AS D30, 
                                                    SUM(IDebitosAgrupado.DM120) AS DM120, SUM(IDebitosAgrupado.D120) AS D120, SUM(IDebitosAgrupado.D90) AS D90, 
                                                    SUM(IDebitosAgrupado.D60) AS D60, SUM(IDebitosAgrupado.D45) AS D45, SUM(IDebitosAgrupado.DIAVALOR) AS DIAVALOR, 
                                                    SUM(tblCustomer_1.[Credit Limit (LCY)]) AS CRDINT, SUM(tblCustomer_1.[COSEC Plafond]) AS COSEC
                          FROM            (SELECT        No_, [Customer Posting Group], SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, SUM(D30) AS D30, SUM(D45) AS D45, SUM(D60) 
                                                                              AS D60, SUM(D90) AS D90, SUM(D120) AS D120, SUM(DM120) AS DM120, SUM(DIAVALOR) AS DIAVALOR
                                                    FROM            (SELECT        tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], 
                                                                                                        tblPaymentTerms.Code AS MdPagamentCode, tblPaymentTerms.Description AS MdPagammentoDesc, 
                                                                                                        tblSalesperson.Code AS VendedorCode, tblSalesperson.Name AS VendedorDesc, 
                                                                                                        tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Posting Date] AS Datadoc, 
                                                                                                        tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() 
                                                                                                        }) AS DIAS, 
                                                                                                        CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                                                         / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, 
                                                                                                        tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                                                        &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                                                         / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, 
                                                                                                        tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, 
                                                                                                        CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                                                         / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, 
                                                                                                        tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIAVALOR, CASE WHEN DATEDIFF(DAY, 
                                                                                                        tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 0 AND DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], 
                                                                                                        { fn NOW() }) 
                                                                                                        &lt; 30 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                                                         / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D30, 
                                                                                                        CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 30 AND DATEDIFF(DAY, 
                                                                                                        tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                                                        &lt; 45 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                                                         / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D45, 
                                                                                                        CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 45 AND DATEDIFF(DAY, 
                                                                                                        tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                                                        &lt; 60 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                                                         / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D60, 
                                                                                                        CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 60 AND DATEDIFF(DAY, 
                                                                                                        tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                                                        &lt; 90 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                                                         / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D90, 
                                                                                                        CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) &gt;= 90 AND DATEDIFF(DAY, 
                                                                                                        tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                                                        &lt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                                                         / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS D120, 
                                                                                                        CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                                                        &gt; 120 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                                                         / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE '0' END AS DM120, 
                                                                                                        tblCustomerLedgerEntry.[Customer Posting Group]
                                                                              FROM            tblCustomer LEFT OUTER JOIN
                                                                                                        tblSalesperson ON tblCustomer.[Salesperson Code] = tblSalesperson.Code LEFT OUTER JOIN
                                                                                                        tblPaymentTerms ON tblCustomer.[Payment Terms Code] = tblPaymentTerms.Code RIGHT OUTER JOIN
                                                                                                        tblCustomerLedgerEntry ON tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_]
                                                                              WHERE        (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND 
                                                                                                        (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv')) AS IDebitos
                                                    GROUP BY [Customer Posting Group], No_) AS IDebitosAgrupado INNER JOIN
                                                    tblCustomer AS tblCustomer_1 ON IDebitosAgrupado.No_ = tblCustomer_1.No_) p UNPIVOT (Montante FOR Idade IN (D30, DM120, D120, D90, 
                         D60, D45)) AS unpvt</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings />
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="dboardAntiguidadeSaldoTableAdapter" GeneratorDataComponentClassName="dboardAntiguidadeSaldoTableAdapter" Name="dboardAntiguidadeSaldo" UserDataComponentName="dboardAntiguidadeSaldoTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="SELECT SUM(mov1_5.Valor) AS valor, mov2_5.[Document Type], mov2_5.[Posting Date], aberto_5.VALOR AS Expr1 FROM (SELECT [Document Type], [Posting Date], SUM([Amount (LCY) stats_]) AS Valor, Company FROM tblCustomerLedgerEntry AS tblCustomerLedgerEntry_11 GROUP BY [Document Type], [Posting Date], Company HAVING ([Document Type] = 2) AND ([Posting Date] &lt;= CONVERT(datetime, @data, 105)) AND (Company = @company)) AS mov1_5 INNER JOIN (SELECT [Document Type], [Posting Date], SUM([Amount (LCY) stats_]) AS valor, Company FROM tblCustomerLedgerEntry AS tblCustomerLedgerEntry_1 GROUP BY [Document Type], [Posting Date], Company HAVING ([Document Type] = 2) AND ([Posting Date] &lt;= CONVERT(datetime, @data, 105)) AND (Company = @company)) AS mov2_5 ON mov1_5.[Posting Date] &gt; mov2_5.[Posting Date] AND mov1_5.[Document Type] = mov2_5.[Document Type] INNER JOIN (SELECT ISNULL(SUM(VALOR), 0) AS VALOR, '2' AS source FROM (SELECT IDebitosAgrupado_5.No_, CONVERT(decimal(18, 2), SUM(IDebitosAgrupado_5.NVENC)) AS NVENC, CONVERT(decimal(18, 2), SUM(IDebitosAgrupado_5.VALOR)) AS VALOR FROM (SELECT No_, SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, Company FROM (SELECT tblCustomer_6.No_, tblCustomerLedgerEntry_10.[Posting Date] AS Datadoc, CONVERT(DECIMAL(18, 2), CASE WHEN tblCustomerLedgerEntry_10.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry_10.[Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry_10.[Amount (LCY) stats_] END) AS VALOR, CONVERT(DECIMAL(18, 2), CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry_10.[Due Date], { fn NOW() }) &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry_10.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry_10.[Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry_10.[Amount (LCY) stats_] END ELSE 0 END) AS NVENC, tblCustomerLedgerEntry_10.[Customer Posting Group], tblCustomerLedgerEntry_10.Company FROM tblCustomer AS tblCustomer_6 RIGHT OUTER JOIN tblCustomerLedgerEntry AS tblCustomerLedgerEntry_10 ON tblCustomer_6.Company = tblCustomerLedgerEntry_10.Company AND tblCustomer_6.No_ = tblCustomerLedgerEntry_10.[Customer No_] WHERE (tblCustomerLedgerEntry_10.[Customer Posting Group] &lt;&gt; 'nac-duv') AND (tblCustomerLedgerEntry_10.[Posting Date] &lt;= CONVERT(datetime, @data, 105)) AND (tblCustomerLedgerEntry_10.Company = @company)) AS IDebitos_9 GROUP BY No_, Company) AS IDebitosAgrupado_5 INNER JOIN tblCustomer AS tblCustomer_1 ON IDebitosAgrupado_5.No_ = tblCustomer_1.No_ AND IDebitosAgrupado_5.Company = tblCustomer_1.Company GROUP BY IDebitosAgrupado_5.No_) AS IDebitos_10) AS aberto_5 ON mov2_5.[Document Type] = aberto_5.source GROUP BY mov2_5.[Document Type], mov2_5.[Posting Date], aberto_5.VALOR HAVING (SUM(mov1_5.Valor) &gt;= aberto_5.VALOR)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT     MAX([Posting Date]) AS data, [Document Type], DATEDIFF(DAY, MAX([Posting Date]),  convert(datetime, @data, 105)) AS DIAS, MONTH( convert(datetime, @data, 105)) AS MES
FROM         (SELECT     SUM(mov1_5.Valor) AS valor, mov2_5.[Document Type], mov2_5.[Posting Date], aberto_5.VALOR AS Expr1
                       FROM          (SELECT     [Document Type], [Posting Date], SUM([Amount (LCY) stats_]) AS Valor, Company
FROM         tblCustomerLedgerEntry AS tblCustomerLedgerEntry_11
GROUP BY [Document Type], [Posting Date], Company
HAVING      ([Document Type] = 2) AND ([Posting Date] &lt;= convert(datetime, @data, 105)) AND (Company = @company)) AS mov1_5 INNER JOIN
                                                  (SELECT     [Document Type], [Posting Date], SUM([Amount (LCY) stats_]) AS valor, Company
FROM         tblCustomerLedgerEntry AS tblCustomerLedgerEntry_1
GROUP BY [Document Type], [Posting Date], Company
HAVING      ([Document Type] = 2) AND ([Posting Date] &lt;= convert(datetime, @data, 105)) AND (Company = @company)) AS mov2_5 ON mov1_5.[Posting Date] &gt; mov2_5.[Posting Date] AND 
                                              mov1_5.[Document Type] = mov2_5.[Document Type] INNER JOIN
                                                  (SELECT     ISNULL(SUM(VALOR), 0) AS VALOR, '2' AS source
FROM         (SELECT     IDebitosAgrupado_5.No_, CONVERT(decimal(18, 2), SUM(IDebitosAgrupado_5.NVENC)) AS NVENC, CONVERT(decimal(18, 2), SUM(IDebitosAgrupado_5.VALOR)) AS VALOR
                       FROM          (SELECT     No_, SUM(NVENC) AS NVENC, SUM(VALOR) AS VALOR, Company
                                               FROM          (SELECT     tblCustomer_6.No_, tblCustomerLedgerEntry_10.[Posting Date] AS Datadoc, CONVERT(DECIMAL(18, 2), 
                                                                                              CASE WHEN tblCustomerLedgerEntry_10.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry_10.[Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry_10.[Amount (LCY) stats_]
                                                                                               END) AS VALOR, CONVERT(DECIMAL(18, 2), CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry_10.[Due Date], { fn NOW() }) 
                                                                                              &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry_10.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry_10.[Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry_10.[Amount (LCY) stats_]
                                                                                               END ELSE 0 END) AS NVENC, tblCustomerLedgerEntry_10.[Customer Posting Group], tblCustomerLedgerEntry_10.Company
                                                                       FROM          tblCustomer AS tblCustomer_6 RIGHT OUTER JOIN
                                                                                              tblCustomerLedgerEntry AS tblCustomerLedgerEntry_10 ON tblCustomer_6.Company = tblCustomerLedgerEntry_10.Company AND 
                                                                                              tblCustomer_6.No_ = tblCustomerLedgerEntry_10.[Customer No_]
                                                                       WHERE      (tblCustomerLedgerEntry_10.[Customer Posting Group] &lt;&gt; 'nac-duv') AND (tblCustomerLedgerEntry_10.[Posting Date] &lt;= convert(datetime, @data, 105)) AND 
                                                                                              (tblCustomerLedgerEntry_10.Company = @company)) AS IDebitos_9
                                               GROUP BY No_, Company) AS IDebitosAgrupado_5 INNER JOIN
                                              tblCustomer AS tblCustomer_1 ON IDebitosAgrupado_5.No_ = tblCustomer_1.No_ AND IDebitosAgrupado_5.Company = tblCustomer_1.Company
                       GROUP BY IDebitosAgrupado_5.No_) AS IDebitos_10) AS aberto_5 ON mov2_5.[Document Type] = aberto_5.source
                       GROUP BY mov2_5.[Document Type], mov2_5.[Posting Date], aberto_5.VALOR
                       HAVING      (SUM(mov1_5.Valor) &gt;= aberto_5.VALOR)) AS a_5
GROUP BY [Document Type]</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="data" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="DateTime" Direction="Input" ParameterName="@data" Precision="0" Scale="0" Size="0" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="company" ColumnName="" DataSourceName="" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@company" Precision="0" Scale="0" Size="50" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="DIAS" DataSetColumn="DIAS" />
              <Mapping SourceColumn="data" DataSetColumn="data" />
              <Mapping SourceColumn="Document Type" DataSetColumn="Document Type" />
              <Mapping SourceColumn="MES" DataSetColumn="MES" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="dboardMDATableAdapter" GeneratorDataComponentClassName="dboardMDATableAdapter" Name="dboardMDA" UserDataComponentName="dboardMDATableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        SUM(VALOR) AS VALOR, SUM(DIAVALOR) AS DIAVALOR, SUM(DIAVALOR) / SUM(VALOR) AS Expr1
FROM            (SELECT        IDebitosAgrupado.No_, SUM(IDebitosAgrupado.NVENC) AS NVENC, SUM(IDebitosAgrupado.VALOR) AS VALOR, SUM(IDebitosAgrupado.DIAVALOR) 
                                                    AS DIAVALOR, SUM(tblCustomer_1.[Credit Limit (LCY)]) AS CRDINT, SUM(tblCustomer_1.[COSEC Plafond]) AS COSEC, 
                                                    IDebitosAgrupado.[Search Name]
                          FROM            (SELECT        dbo.tblCustomer.No_, dbo.tblCustomerLedgerEntry.[Customer No_], dbo.tblCustomer.[Search Name], 
                                                                              dbo.tblCustomerLedgerEntry.[Document No_], dbo.tblCustomerLedgerEntry.[Posting Date] AS Datadoc, 
                                                                              dbo.tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, dbo.tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              AS DIAS, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END AS VALOR, CASE WHEN DATEDIFF(DAY, 
                                                                              tblCustomerLedgerEntry.[Due Date], { fn NOW() }) 
                                                                              &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                                                                               / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END ELSE 0 END AS NVENC, DATEDIFF(DAY, 
                                                                              dbo.tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, 
                                                                              CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1
                                                                               ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] END * DATEDIFF(DAY, dbo.tblCustomerLedgerEntry.[Due Date], 
                                                                              { fn NOW() }) AS DIAVALOR, dbo.tblCustomerLedgerEntry.[Customer Posting Group], dbo.tblCustomerLedgerEntry.[Document Type], 
                                                                              dbo.tblCustomerLedgerEntry.Company
                                                    FROM            dbo.tblCustomer RIGHT OUTER JOIN
                                                                              dbo.tblCustomerLedgerEntry ON dbo.tblCustomer.Company = dbo.tblCustomerLedgerEntry.Company AND 
                                                                              dbo.tblCustomer.No_ = dbo.tblCustomerLedgerEntry.[Customer No_]
                                                    WHERE        (dbo.tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND 
                                                                              (dbo.tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv') AND (dbo.tblCustomerLedgerEntry.[Document Type] = 2) AND 
                                                                              (dbo.tblCustomerLedgerEntry.[Due Date] &lt;= { fn NOW() }) AND (dbo.tblCustomerLedgerEntry.Company = @company)) 
                                                    AS IDebitosAgrupado INNER JOIN
                                                    dbo.tblCustomer AS tblCustomer_1 ON IDebitosAgrupado.No_ = tblCustomer_1.No_
                          GROUP BY IDebitosAgrupado.No_, IDebitosAgrupado.[Search Name]) AS derivedtbl_1</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="company" ColumnName="" DataSourceName="" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@company" Precision="0" Scale="0" Size="50" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="VALOR" DataSetColumn="VALOR" />
              <Mapping SourceColumn="DIAVALOR" DataSetColumn="DIAVALOR" />
              <Mapping SourceColumn="Expr1" DataSetColumn="Expr1" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="dboardMDVencimentoTableAdapter" GeneratorDataComponentClassName="dboardMDVencimentoTableAdapter" Name="dboardMDVencimento" UserDataComponentName="dboardMDVencimentoTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT     SUM(VALOR) AS VALOR, SUM(DIAVALOR) AS DIAVALOR, SUM(DIAVALOR) / SUM(VALOR) AS Expr1
FROM         (SELECT     IDebitosAgrupado.No_, SUM(IDebitosAgrupado.NVENC) AS NVENC, SUM(IDebitosAgrupado.VALOR) AS VALOR, SUM(IDebitosAgrupado.DIAVALOR) AS DIAVALOR, 
                                              SUM(tblCustomer_1.[Credit Limit (LCY)]) AS CRDINT, SUM(tblCustomer_1.[COSEC Plafond]) AS COSEC, IDebitosAgrupado.[Search Name]
                       FROM          (SELECT     tblCustomer.No_, tblCustomerLedgerEntry.[Customer No_], tblCustomer.[Search Name], tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Posting Date] AS Datadoc, 
                      tblCustomerLedgerEntry.[Due Date] AS DataVencimento, DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], { fn NOW() }) AS DIAS, 
                      CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                       END AS VALOR, CASE WHEN DATEDIFF(DAY, tblCustomerLedgerEntry.[Due Date], tblCustomerLedgerEntry.[pOSTING Date]) 
                      &lt; 0 THEN CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                       END ELSE 0 END AS NVENC, DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], { fn NOW() }) AS DIASDOC, 
                      CASE WHEN tblCustomerLedgerEntry.[Source Code] = 'ESTORNO' THEN tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] / - 1 ELSE tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_]
                       END * DATEDIFF(DAY, tblCustomerLedgerEntry.[Posting Date], tblCustomerLedgerEntry.[Due Date]) AS DIAVALOR, tblCustomerLedgerEntry.[Customer Posting Group], 
                      tblCustomerLedgerEntry.[Document Type], tblCustomerLedgerEntry.Company
FROM         tblCustomer RIGHT OUTER JOIN
                      tblCustomerLedgerEntry ON tblCustomer.Company = tblCustomerLedgerEntry.Company AND tblCustomer.No_ = tblCustomerLedgerEntry.[Customer No_]
WHERE     (tblCustomerLedgerEntry.[Remaining Amount (LCY) stats_] &lt;&gt; 0) AND (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv') AND (tblCustomerLedgerEntry.[Document Type] = 2) AND 
                      (tblCustomerLedgerEntry.Company = @company)) AS IDebitosAgrupado INNER JOIN
                                              tblCustomer AS tblCustomer_1 ON IDebitosAgrupado.No_ = tblCustomer_1.No_
                       GROUP BY IDebitosAgrupado.No_, IDebitosAgrupado.[Search Name]) AS derivedtbl_1</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="company" ColumnName="" DataSourceName="" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@company" Precision="0" Scale="0" Size="50" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="VALOR" DataSetColumn="VALOR" />
              <Mapping SourceColumn="DIAVALOR" DataSetColumn="DIAVALOR" />
              <Mapping SourceColumn="Expr1" DataSetColumn="Expr1" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RIDebitosAgrupadoTableAdapter" GeneratorDataComponentClassName="RIDebitosAgrupadoTableAdapter" Name="RIDebitosAgrupado" UserDataComponentName="RIDebitosAgrupadoTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="SELECT b.[Customer No_], b.[Customer Posting Group], tblCustomer_1.[Customer Posting Group] AS PostGroupCliente, SUM(b.NVenc) AS NVenc, SUM(b.Valor) AS Valor, SUM(b.[30D]) AS [30D], SUM(b.[45D]) AS [45D], SUM(b.[60D]) AS [60D], SUM(b.[90D]) AS [90D], SUM(b.[120D]) AS [120D], SUM(b.[&gt;120D]) AS [&gt;120D], tblCustomer_1.[Credit Limit (LCY)] AS CredInt, tblCustomer_1.[COSEC Plafond] AS COSEC, CASE WHEN b.[Customer Posting Group] = tblCustomer_1.[Customer Posting Group] AND SUM(b.Valor) &lt;&gt; 0 THEN tblCustomer_1.[Credit Limit (LCY)] END AS CreditoInterno, CASE WHEN b.[Customer Posting Group] = tblCustomer_1.[Customer Posting Group] AND SUM(b.Valor) &lt;&gt; 0 THEN tblCustomer_1.[COSEC Plafond] END AS CosecCliente, SUM(b.DiasValor) AS DiasValor FROM (SELECT DiasVenc, NVenc, Valor, CASE WHEN diasvenc &lt;= 30 AND diasvenc &gt; 0 THEN Valor ELSE 0 END AS [30D], CASE WHEN diasvenc &lt;= 45 AND diasvenc &gt; 30 THEN Valor ELSE 0 END AS [45D], CASE WHEN diasvenc &lt;= 60 AND diasvenc &gt; 45 THEN Valor ELSE 0 END AS [60D], CASE WHEN diasvenc &lt;= 90 AND diasvenc &gt; 60 THEN Valor ELSE 0 END AS [90D], CASE WHEN diasvenc &lt;= 120 AND diasvenc &gt; 90 THEN Valor ELSE 0 END AS [120D], CASE WHEN diasvenc &gt; 120 THEN Valor ELSE 0 END AS [&gt;120D], [Customer Posting Group], [Customer No_], [Due Date], Vencido, DiasValor FROM (SELECT CONVERT(decimal(18, 2), SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)])) AS Valor, tblCustomerLedgerEntry.[Customer No_], CASE WHEN DATEDIFF(day, tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, getdate(), 101)) &gt; 0 THEN CONVERT(decimal(18, 2), SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)])) ELSE 0 END AS Vencido, CASE WHEN DATEDIFF(day, tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, getdate(), 101)) &lt;= 0 THEN CONVERT(decimal(18, 2), SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)])) ELSE 0 END AS NVenc, DATEDIFF(day, tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, GETDATE(), 101)) AS DiasVenc, CASE WHEN DATEDIFF(day, tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, getdate(), 101)) &gt; 0 THEN SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)]) * DATEDIFF(day, tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, getdate(), 101)) ELSE 0 END AS DiasValor, tblCustomerLedgerEntry.[Customer Posting Group], tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Document Type], tblDetailedCustomerLedgerEntry.[Initial Entry Due Date] AS [Due Date] FROM tblCustomerLedgerEntry INNER JOIN tblDetailedCustomerLedgerEntry ON tblCustomerLedgerEntry.[Entry No_] = tblDetailedCustomerLedgerEntry.[Cust_ Ledger Entry No_] INNER JOIN tblCustomer ON tblCustomerLedgerEntry.[Customer No_] = tblCustomer.No_ WHERE (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv') AND (tblDetailedCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; '') AND (tblCustomerLedgerEntry.Company = @COMPANY) AND (tblCustomer.Company = @COMPANY) AND (tblDetailedCustomerLedgerEntry.Company = @COMPANY) GROUP BY tblCustomerLedgerEntry.[Customer No_], tblCustomerLedgerEntry.[Customer Posting Group], tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Document Type], tblDetailedCustomerLedgerEntry.[Initial Entry Due Date] HAVING (CONVERT(decimal(18, 2), SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)])) &lt;&gt; 0)) AS a) AS b INNER JOIN tblCustomer AS tblCustomer_1 ON b.[Customer No_] = tblCustomer_1.No_ GROUP BY b.[Customer Posting Group], b.[Customer No_], tblCustomer_1.[Customer Posting Group], tblCustomer_1.[Credit Limit (LCY)], tblCustomer_1.[COSEC Plafond], tblCustomer_1.Company HAVING (tblCustomer_1.Company = @company)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        [Customer Posting Group], SUM(NVenc) AS NVenc, SUM(Valor) AS Valor, SUM([30D]) AS [30D], SUM([45D]) AS [45D], SUM([60D]) AS [60D], SUM([90D]) AS [90D],
                          SUM([120D]) AS [120D], SUM([&gt;120D]) AS [&gt;120D], SUM(CosecCliente) AS CosecCliente, SUM(CreditoInterno) AS CreditoInterno, SUM(DiasValor) AS DiasValor,
                          SUM(DiasValor) / NULLIF (SUM(Valor) - SUM(NVenc), 0) AS MDA
FROM            (SELECT        b.[Customer No_], b.[Customer Posting Group], tblCustomer_1.[Customer Posting Group] AS PostGroupCliente, SUM(b.NVenc) AS NVenc, 
                                                    SUM(b.Valor) AS Valor, SUM(b.[30D]) AS [30D], SUM(b.[45D]) AS [45D], SUM(b.[60D]) AS [60D], SUM(b.[90D]) AS [90D], SUM(b.[120D]) AS [120D], 
                                                    SUM(b.[&gt;120D]) AS [&gt;120D], tblCustomer_1.[Credit Limit (LCY)] AS CredInt, tblCustomer_1.[COSEC Plafond] AS COSEC, 
                                                    CASE WHEN b.[Customer Posting Group] = tblCustomer_1.[Customer Posting Group] AND SUM(b.Valor) 
                                                    &lt;&gt; 0 THEN tblCustomer_1.[Credit Limit (LCY)] END AS CreditoInterno, 
                                                    CASE WHEN b.[Customer Posting Group] = tblCustomer_1.[Customer Posting Group] AND SUM(b.Valor) 
                                                    &lt;&gt; 0 THEN tblCustomer_1.[COSEC Plafond] END AS CosecCliente, SUM(b.DiasValor) AS DiasValor
                          FROM            (SELECT        DiasVenc, NVenc, Valor, CASE WHEN diasvenc &lt;= 30 AND diasvenc &gt; 0 THEN Valor ELSE 0 END AS [30D], 
                                                                              CASE WHEN diasvenc &lt;= 45 AND diasvenc &gt; 30 THEN Valor ELSE 0 END AS [45D], CASE WHEN diasvenc &lt;= 60 AND 
                                                                              diasvenc &gt; 45 THEN Valor ELSE 0 END AS [60D], CASE WHEN diasvenc &lt;= 90 AND diasvenc &gt; 60 THEN Valor ELSE 0 END AS [90D], 
                                                                              CASE WHEN diasvenc &lt;= 120 AND diasvenc &gt; 90 THEN Valor ELSE 0 END AS [120D], 
                                                                              CASE WHEN diasvenc &gt; 120 THEN Valor ELSE 0 END AS [&gt;120D], [Customer Posting Group], [Customer No_], [Due Date], Vencido, 
                                                                              DiasValor
                                                    FROM            (SELECT        CONVERT(decimal(18, 2), SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)])) AS Valor, 
                                                                                                        tblCustomerLedgerEntry.[Customer No_], CASE WHEN DATEDIFF(day, 
                                                                                                        tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, getdate(), 101)) 
                                                                                                        &gt; 0 THEN CONVERT(decimal(18, 2), SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)])) ELSE 0 END AS Vencido, 
                                                                                                        CASE WHEN DATEDIFF(day, tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, getdate(), 101)) 
                                                                                                        &lt;= 0 THEN CONVERT(decimal(18, 2), SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)])) ELSE 0 END AS NVenc, 
                                                                                                        DATEDIFF(day, tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, GETDATE(), 101)) 
                                                                                                        AS DiasVenc, CASE WHEN DATEDIFF(day, tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, 
                                                                                                        getdate(), 101)) &gt; 0 THEN SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)]) * DATEDIFF(day, 
                                                                                                        tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, getdate(), 101)) ELSE 0 END AS DiasValor, 
                                                                                                        tblCustomerLedgerEntry.[Customer Posting Group], tblCustomerLedgerEntry.[Document No_], 
                                                                                                        tblCustomerLedgerEntry.[Document Type], tblDetailedCustomerLedgerEntry.[Initial Entry Due Date] AS [Due Date]
                                                                              FROM            tblCustomerLedgerEntry INNER JOIN
                                                                                                        tblDetailedCustomerLedgerEntry ON 
                                                                                                        tblCustomerLedgerEntry.[Entry No_] = tblDetailedCustomerLedgerEntry.[Cust_ Ledger Entry No_] INNER JOIN
                                                                                                        tblCustomer ON tblCustomerLedgerEntry.[Customer No_] = tblCustomer.No_
                                                                              WHERE        (tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv') AND 
                                                                                                        (tblDetailedCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; '') AND (tblCustomerLedgerEntry.Company = @COMPANY)
                                                                                                         AND (tblCustomer.Company = @COMPANY) AND (tblDetailedCustomerLedgerEntry.Company = @COMPANY)
                                                                              GROUP BY tblCustomerLedgerEntry.[Customer No_], tblCustomerLedgerEntry.[Customer Posting Group], 
                                                                                                        tblCustomerLedgerEntry.[Document No_], tblCustomerLedgerEntry.[Document Type], 
                                                                                                        tblDetailedCustomerLedgerEntry.[Initial Entry Due Date]
                                                                              HAVING         (CONVERT(decimal(18, 2), SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)])) &lt;&gt; 0)) AS a) AS b INNER JOIN
                                                    tblCustomer AS tblCustomer_1 ON b.[Customer No_] = tblCustomer_1.No_
                          GROUP BY b.[Customer Posting Group], b.[Customer No_], tblCustomer_1.[Customer Posting Group], tblCustomer_1.[Credit Limit (LCY)], 
                                                    tblCustomer_1.[COSEC Plafond], tblCustomer_1.Company
                          HAVING         (tblCustomer_1.Company = @company)) AS c
GROUP BY [Customer Posting Group]</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="company" ColumnName="" DataSourceName="" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@company" Precision="0" Scale="0" Size="50" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Customer Posting Group" DataSetColumn="Customer Posting Group" />
              <Mapping SourceColumn="NVenc" DataSetColumn="NVenc" />
              <Mapping SourceColumn="Valor" DataSetColumn="Valor" />
              <Mapping SourceColumn="30D" DataSetColumn="30D" />
              <Mapping SourceColumn="45D" DataSetColumn="45D" />
              <Mapping SourceColumn="60D" DataSetColumn="60D" />
              <Mapping SourceColumn="90D" DataSetColumn="90D" />
              <Mapping SourceColumn="120D" DataSetColumn="120D" />
              <Mapping SourceColumn="&gt;120D" DataSetColumn="&gt;120D" />
              <Mapping SourceColumn="CosecCliente" DataSetColumn="CosecCliente" />
              <Mapping SourceColumn="CreditoInterno" DataSetColumn="CreditoInterno" />
              <Mapping SourceColumn="DiasValor" DataSetColumn="DiasValor" />
              <Mapping SourceColumn="MDA" DataSetColumn="MDA" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RIdebitosGeralTableAdapter" GeneratorDataComponentClassName="RIdebitosGeralTableAdapter" Name="RIdebitosGeral" UserDataComponentName="RIdebitosGeralTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        b.[Customer No_], SUM(b.NVenc) AS NVenc, SUM(b.Valor) AS Valor, SUM(b.[30D]) AS [30D], SUM(b.[45D]) AS [45D], SUM(b.[60D]) AS [60D], SUM(b.[90D]) 
                         AS [90D], SUM(b.[120D]) AS [120D], SUM(b.[&gt;120D]) AS [&gt;120D], tblCustomer_1.[Credit Limit (LCY)] AS CredInt, tblCustomer_1.[COSEC Plafond] AS COSEC, 
                         tblCustomer_1.[Credit Limit (LCY)] AS CreditoInterno, tblCustomer_1.[COSEC Plafond] AS CosecCliente, SUM(b.DiasValor) AS DiasValor, 
                         tblCustomer_1.Name AS ClienteNome, dbo.tblPaymentTerms.Code AS CodPagamento, dbo.tblPaymentTerms.Description AS DescPagamento, 
                         SUM(b.DiasValor) / NULLIF (SUM(b.Valor) - SUM(b.NVenc), 0) AS MDA
FROM            (SELECT        DiasVenc, NVenc, Valor, CASE WHEN diasvenc &lt;= 30 AND diasvenc &gt; 0 THEN Valor ELSE 0 END AS [30D], CASE WHEN diasvenc &lt;= 45 AND 
                                                    diasvenc &gt; 30 THEN Valor ELSE 0 END AS [45D], CASE WHEN diasvenc &lt;= 60 AND diasvenc &gt; 45 THEN Valor ELSE 0 END AS [60D], 
                                                    CASE WHEN diasvenc &lt;= 90 AND diasvenc &gt; 60 THEN Valor ELSE 0 END AS [90D], CASE WHEN diasvenc &lt;= 120 AND 
                                                    diasvenc &gt; 90 THEN Valor ELSE 0 END AS [120D], CASE WHEN diasvenc &gt; 120 THEN Valor ELSE 0 END AS [&gt;120D], [Customer Posting Group], 
                                                    [Customer No_], [Due Date], Vencido, DiasValor
                          FROM            (SELECT        CONVERT(decimal(18, 2), SUM(dbo.tblDetailedCustomerLedgerEntry.[Amount (LCY)])) AS Valor, 
                                                                              dbo.tblCustomerLedgerEntry.[Customer No_], CASE WHEN DATEDIFF(day, tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], 
                                                                              CONVERT(varchar, getdate(), 101)) &gt; 0 THEN CONVERT(decimal(18, 2), SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)])) 
                                                                              ELSE 0 END AS Vencido, CASE WHEN DATEDIFF(day, tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, 
                                                                              getdate(), 101)) &lt;= 0 THEN CONVERT(decimal(18, 2), SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)])) ELSE 0 END AS NVenc, 
                                                                              DATEDIFF(day, dbo.tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, GETDATE(), 101)) AS DiasVenc, 
                                                                              CASE WHEN DATEDIFF(day, tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, getdate(), 101)) 
                                                                              &gt; 0 THEN SUM(tblDetailedCustomerLedgerEntry.[Amount (LCY)]) * DATEDIFF(day, 
                                                                              tblDetailedCustomerLedgerEntry.[Initial Entry Due Date], CONVERT(varchar, getdate(), 101)) ELSE 0 END AS DiasValor, 
                                                                              dbo.tblCustomerLedgerEntry.[Customer Posting Group], dbo.tblCustomerLedgerEntry.[Document No_], 
                                                                              dbo.tblCustomerLedgerEntry.[Document Type], dbo.tblDetailedCustomerLedgerEntry.[Initial Entry Due Date] AS [Due Date]
                                                    FROM            dbo.tblCustomerLedgerEntry INNER JOIN
                                                                              dbo.tblDetailedCustomerLedgerEntry ON 
                                                                              dbo.tblCustomerLedgerEntry.[Entry No_] = dbo.tblDetailedCustomerLedgerEntry.[Cust_ Ledger Entry No_] INNER JOIN
                                                                              dbo.tblCustomer ON dbo.tblCustomerLedgerEntry.[Customer No_] = dbo.tblCustomer.No_
                                                    WHERE        (dbo.tblCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; 'nac-duv') AND 
                                                                              (dbo.tblDetailedCustomerLedgerEntry.[Customer Posting Group] &lt;&gt; '') AND (dbo.tblCustomerLedgerEntry.Company = @COMPANY) 
                                                                              AND (dbo.tblCustomer.Company = @COMPANY) AND (dbo.tblDetailedCustomerLedgerEntry.Company = @COMPANY)
                                                    GROUP BY dbo.tblCustomerLedgerEntry.[Customer No_], dbo.tblCustomerLedgerEntry.[Customer Posting Group], 
                                                                              dbo.tblCustomerLedgerEntry.[Document No_], dbo.tblCustomerLedgerEntry.[Document Type], 
                                                                              dbo.tblDetailedCustomerLedgerEntry.[Initial Entry Due Date]
                                                    HAVING         (CONVERT(decimal(18, 2), SUM(dbo.tblDetailedCustomerLedgerEntry.[Amount (LCY)])) &lt;&gt; 0)) AS a) AS b INNER JOIN
                         dbo.tblCustomer AS tblCustomer_1 ON b.[Customer No_] = tblCustomer_1.No_ LEFT OUTER JOIN
                         dbo.tblPaymentTerms ON tblCustomer_1.[Payment Terms Code] = dbo.tblPaymentTerms.Code
GROUP BY b.[Customer No_], tblCustomer_1.[Credit Limit (LCY)], tblCustomer_1.[COSEC Plafond], tblCustomer_1.Name, dbo.tblPaymentTerms.Code, 
                         dbo.tblPaymentTerms.Description</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="COMPANY" ColumnName="" DataSourceName="" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@COMPANY" Precision="0" Scale="0" Size="50" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Customer No_" DataSetColumn="Customer No_" />
              <Mapping SourceColumn="NVenc" DataSetColumn="NVenc" />
              <Mapping SourceColumn="Valor" DataSetColumn="Valor" />
              <Mapping SourceColumn="30D" DataSetColumn="30D" />
              <Mapping SourceColumn="45D" DataSetColumn="45D" />
              <Mapping SourceColumn="60D" DataSetColumn="60D" />
              <Mapping SourceColumn="90D" DataSetColumn="90D" />
              <Mapping SourceColumn="120D" DataSetColumn="120D" />
              <Mapping SourceColumn="&gt;120D" DataSetColumn="&gt;120D" />
              <Mapping SourceColumn="CredInt" DataSetColumn="CredInt" />
              <Mapping SourceColumn="COSEC" DataSetColumn="COSEC" />
              <Mapping SourceColumn="CreditoInterno" DataSetColumn="CreditoInterno" />
              <Mapping SourceColumn="CosecCliente" DataSetColumn="CosecCliente" />
              <Mapping SourceColumn="DiasValor" DataSetColumn="DiasValor" />
              <Mapping SourceColumn="ClienteNome" DataSetColumn="ClienteNome" />
              <Mapping SourceColumn="CodPagamento" DataSetColumn="CodPagamento" />
              <Mapping SourceColumn="DescPagamento" DataSetColumn="DescPagamento" />
              <Mapping SourceColumn="MDA" DataSetColumn="MDA" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="DsIDebitos" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_DataSetName="DsIDebitos" msprop:Generator_UserDSName="DsIDebitos">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="RIDebitos" msprop:Generator_TableClassName="RIDebitosDataTable" msprop:Generator_TableVarName="tableRIDebitos" msprop:Generator_TablePropName="RIDebitos" msprop:Generator_RowDeletingName="RIDebitosRowDeleting" msprop:Generator_RowChangingName="RIDebitosRowChanging" msprop:Generator_RowEvHandlerName="RIDebitosRowChangeEventHandler" msprop:Generator_RowDeletedName="RIDebitosRowDeleted" msprop:Generator_UserTableName="RIDebitos" msprop:Generator_RowChangedName="RIDebitosRowChanged" msprop:Generator_RowEvArgName="RIDebitosRowChangeEvent" msprop:Generator_RowClassName="RIDebitosRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="No_" msprop:Generator_ColumnVarNameInTable="columnNo_" msprop:Generator_ColumnPropNameInRow="No_" msprop:Generator_ColumnPropNameInTable="No_Column" msprop:Generator_UserColumnName="No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Search_x0020_Name" msprop:Generator_ColumnVarNameInTable="columnSearch_Name" msprop:Generator_ColumnPropNameInRow="Search_Name" msprop:Generator_ColumnPropNameInTable="Search_NameColumn" msprop:Generator_UserColumnName="Search Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="MdPagamentCode" msprop:Generator_ColumnVarNameInTable="columnMdPagamentCode" msprop:Generator_ColumnPropNameInRow="MdPagamentCode" msprop:Generator_ColumnPropNameInTable="MdPagamentCodeColumn" msprop:Generator_UserColumnName="MdPagamentCode" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="MdPagammentoDesc" msprop:Generator_ColumnVarNameInTable="columnMdPagammentoDesc" msprop:Generator_ColumnPropNameInRow="MdPagammentoDesc" msprop:Generator_ColumnPropNameInTable="MdPagammentoDescColumn" msprop:Generator_UserColumnName="MdPagammentoDesc" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="VendedorCode" msprop:Generator_ColumnVarNameInTable="columnVendedorCode" msprop:Generator_ColumnPropNameInRow="VendedorCode" msprop:Generator_ColumnPropNameInTable="VendedorCodeColumn" msprop:Generator_UserColumnName="VendedorCode" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="VendedorDesc" msprop:Generator_ColumnVarNameInTable="columnVendedorDesc" msprop:Generator_ColumnPropNameInRow="VendedorDesc" msprop:Generator_ColumnPropNameInTable="VendedorDescColumn" msprop:Generator_UserColumnName="VendedorDesc" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Document_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnDocument_No_" msprop:Generator_ColumnPropNameInRow="Document_No_" msprop:Generator_ColumnPropNameInTable="Document_No_Column" msprop:Generator_UserColumnName="Document No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Datadoc" msprop:Generator_ColumnVarNameInTable="columnDatadoc" msprop:Generator_ColumnPropNameInRow="Datadoc" msprop:Generator_ColumnPropNameInTable="DatadocColumn" msprop:Generator_UserColumnName="Datadoc" type="xs:dateTime" minOccurs="0" />
              <xs:element name="DataVencimento" msprop:Generator_ColumnVarNameInTable="columnDataVencimento" msprop:Generator_ColumnPropNameInRow="DataVencimento" msprop:Generator_ColumnPropNameInTable="DataVencimentoColumn" msprop:Generator_UserColumnName="DataVencimento" type="xs:dateTime" minOccurs="0" />
              <xs:element name="DIAS" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDIAS" msprop:Generator_ColumnPropNameInRow="DIAS" msprop:Generator_ColumnPropNameInTable="DIASColumn" msprop:Generator_UserColumnName="DIAS" type="xs:int" minOccurs="0" />
              <xs:element name="VALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVALOR" msprop:Generator_ColumnPropNameInRow="VALOR" msprop:Generator_ColumnPropNameInTable="VALORColumn" msprop:Generator_UserColumnName="VALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="NVENC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNVENC" msprop:Generator_ColumnPropNameInRow="NVENC" msprop:Generator_ColumnPropNameInTable="NVENCColumn" msprop:Generator_UserColumnName="NVENC" type="xs:decimal" minOccurs="0" />
              <xs:element name="DIASDOC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDIASDOC" msprop:Generator_ColumnPropNameInRow="DIASDOC" msprop:Generator_ColumnPropNameInTable="DIASDOCColumn" msprop:Generator_UserColumnName="DIASDOC" type="xs:int" minOccurs="0" />
              <xs:element name="DIAVALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDIAVALOR" msprop:Generator_ColumnPropNameInRow="DIAVALOR" msprop:Generator_ColumnPropNameInTable="DIAVALORColumn" msprop:Generator_UserColumnName="DIAVALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="D30" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD30" msprop:Generator_ColumnPropNameInRow="D30" msprop:Generator_ColumnPropNameInTable="D30Column" msprop:Generator_UserColumnName="D30" type="xs:decimal" minOccurs="0" />
              <xs:element name="D45" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD45" msprop:Generator_ColumnPropNameInRow="D45" msprop:Generator_ColumnPropNameInTable="D45Column" msprop:Generator_UserColumnName="D45" type="xs:decimal" minOccurs="0" />
              <xs:element name="D60" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD60" msprop:Generator_ColumnPropNameInRow="D60" msprop:Generator_ColumnPropNameInTable="D60Column" msprop:Generator_UserColumnName="D60" type="xs:decimal" minOccurs="0" />
              <xs:element name="D90" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD90" msprop:Generator_ColumnPropNameInRow="D90" msprop:Generator_ColumnPropNameInTable="D90Column" msprop:Generator_UserColumnName="D90" type="xs:decimal" minOccurs="0" />
              <xs:element name="D120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD120" msprop:Generator_ColumnPropNameInRow="D120" msprop:Generator_ColumnPropNameInTable="D120Column" msprop:Generator_UserColumnName="D120" type="xs:decimal" minOccurs="0" />
              <xs:element name="DM120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDM120" msprop:Generator_ColumnPropNameInRow="DM120" msprop:Generator_ColumnPropNameInTable="DM120Column" msprop:Generator_UserColumnName="DM120" type="xs:decimal" minOccurs="0" />
              <xs:element name="Customer_x0020_Posting_x0020_Group" msprop:Generator_ColumnVarNameInTable="columnCustomer_Posting_Group" msprop:Generator_ColumnPropNameInRow="Customer_Posting_Group" msprop:Generator_ColumnPropNameInTable="Customer_Posting_GroupColumn" msprop:Generator_UserColumnName="Customer Posting Group" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Customer_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnCustomer_No_" msprop:Generator_ColumnPropNameInRow="Customer_No_" msprop:Generator_ColumnPropNameInTable="Customer_No_Column" msprop:Generator_UserColumnName="Customer No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RIDebitosGLOBAL" msprop:Generator_TableClassName="RIDebitosGLOBALDataTable" msprop:Generator_TableVarName="tableRIDebitosGLOBAL" msprop:Generator_TablePropName="RIDebitosGLOBAL" msprop:Generator_RowDeletingName="RIDebitosGLOBALRowDeleting" msprop:Generator_RowChangingName="RIDebitosGLOBALRowChanging" msprop:Generator_RowEvHandlerName="RIDebitosGLOBALRowChangeEventHandler" msprop:Generator_RowDeletedName="RIDebitosGLOBALRowDeleted" msprop:Generator_UserTableName="RIDebitosGLOBAL" msprop:Generator_RowChangedName="RIDebitosGLOBALRowChanged" msprop:Generator_RowEvArgName="RIDebitosGLOBALRowChangeEvent" msprop:Generator_RowClassName="RIDebitosGLOBALRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="No_" msprop:Generator_ColumnVarNameInTable="columnNo_" msprop:Generator_ColumnPropNameInRow="No_" msprop:Generator_ColumnPropNameInTable="No_Column" msprop:Generator_UserColumnName="No_">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Search_x0020_Name" msprop:Generator_ColumnVarNameInTable="columnSearch_Name" msprop:Generator_ColumnPropNameInRow="Search_Name" msprop:Generator_ColumnPropNameInTable="Search_NameColumn" msprop:Generator_UserColumnName="Search Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="MdPagammentoDesc" msprop:Generator_ColumnVarNameInTable="columnMdPagammentoDesc" msprop:Generator_ColumnPropNameInRow="MdPagammentoDesc" msprop:Generator_ColumnPropNameInTable="MdPagammentoDescColumn" msprop:Generator_UserColumnName="MdPagammentoDesc" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="NVENC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNVENC" msprop:Generator_ColumnPropNameInRow="NVENC" msprop:Generator_ColumnPropNameInTable="NVENCColumn" msprop:Generator_UserColumnName="NVENC" type="xs:decimal" minOccurs="0" />
              <xs:element name="VALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVALOR" msprop:Generator_ColumnPropNameInRow="VALOR" msprop:Generator_ColumnPropNameInTable="VALORColumn" msprop:Generator_UserColumnName="VALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="D30" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD30" msprop:Generator_ColumnPropNameInRow="D30" msprop:Generator_ColumnPropNameInTable="D30Column" msprop:Generator_UserColumnName="D30" type="xs:decimal" minOccurs="0" />
              <xs:element name="D45" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD45" msprop:Generator_ColumnPropNameInRow="D45" msprop:Generator_ColumnPropNameInTable="D45Column" msprop:Generator_UserColumnName="D45" type="xs:decimal" minOccurs="0" />
              <xs:element name="D60" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD60" msprop:Generator_ColumnPropNameInRow="D60" msprop:Generator_ColumnPropNameInTable="D60Column" msprop:Generator_UserColumnName="D60" type="xs:decimal" minOccurs="0" />
              <xs:element name="D90" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD90" msprop:Generator_ColumnPropNameInRow="D90" msprop:Generator_ColumnPropNameInTable="D90Column" msprop:Generator_UserColumnName="D90" type="xs:decimal" minOccurs="0" />
              <xs:element name="D120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD120" msprop:Generator_ColumnPropNameInRow="D120" msprop:Generator_ColumnPropNameInTable="D120Column" msprop:Generator_UserColumnName="D120" type="xs:decimal" minOccurs="0" />
              <xs:element name="DM120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDM120" msprop:Generator_ColumnPropNameInRow="DM120" msprop:Generator_ColumnPropNameInTable="DM120Column" msprop:Generator_UserColumnName="DM120" type="xs:decimal" minOccurs="0" />
              <xs:element name="DIAVALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDIAVALOR" msprop:Generator_ColumnPropNameInRow="DIAVALOR" msprop:Generator_ColumnPropNameInTable="DIAVALORColumn" msprop:Generator_UserColumnName="DIAVALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="CRDINT" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCRDINT" msprop:Generator_ColumnPropNameInRow="CRDINT" msprop:Generator_ColumnPropNameInTable="CRDINTColumn" msprop:Generator_UserColumnName="CRDINT" type="xs:decimal" minOccurs="0" />
              <xs:element name="COSEC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCOSEC" msprop:Generator_ColumnPropNameInRow="COSEC" msprop:Generator_ColumnPropNameInTable="COSECColumn" msprop:Generator_UserColumnName="COSEC" type="xs:decimal" minOccurs="0" />
              <xs:element name="VendedorDesc" msprop:Generator_ColumnVarNameInTable="columnVendedorDesc" msprop:Generator_ColumnPropNameInRow="VendedorDesc" msprop:Generator_ColumnPropNameInTable="VendedorDescColumn" msprop:Generator_UserColumnName="VendedorDesc" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RIDebitosVendedor" msprop:Generator_TableClassName="RIDebitosVendedorDataTable" msprop:Generator_TableVarName="tableRIDebitosVendedor" msprop:Generator_RowChangedName="RIDebitosVendedorRowChanged" msprop:Generator_TablePropName="RIDebitosVendedor" msprop:Generator_RowDeletingName="RIDebitosVendedorRowDeleting" msprop:Generator_RowChangingName="RIDebitosVendedorRowChanging" msprop:Generator_RowEvHandlerName="RIDebitosVendedorRowChangeEventHandler" msprop:Generator_RowDeletedName="RIDebitosVendedorRowDeleted" msprop:Generator_RowClassName="RIDebitosVendedorRow" msprop:Generator_UserTableName="RIDebitosVendedor" msprop:Generator_RowEvArgName="RIDebitosVendedorRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="VendedorDesc" msprop:Generator_ColumnVarNameInTable="columnVendedorDesc" msprop:Generator_ColumnPropNameInRow="VendedorDesc" msprop:Generator_ColumnPropNameInTable="VendedorDescColumn" msprop:Generator_UserColumnName="VendedorDesc" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="No_" msprop:Generator_ColumnVarNameInTable="columnNo_" msprop:Generator_ColumnPropNameInRow="No_" msprop:Generator_ColumnPropNameInTable="No_Column" msprop:Generator_UserColumnName="No_">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Search_x0020_Name" msprop:Generator_ColumnVarNameInTable="columnSearch_Name" msprop:Generator_ColumnPropNameInRow="Search_Name" msprop:Generator_ColumnPropNameInTable="Search_NameColumn" msprop:Generator_UserColumnName="Search Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="CRDINT" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCRDINT" msprop:Generator_ColumnPropNameInRow="CRDINT" msprop:Generator_ColumnPropNameInTable="CRDINTColumn" msprop:Generator_UserColumnName="CRDINT" type="xs:decimal" minOccurs="0" />
              <xs:element name="COSEC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCOSEC" msprop:Generator_ColumnPropNameInRow="COSEC" msprop:Generator_ColumnPropNameInTable="COSECColumn" msprop:Generator_UserColumnName="COSEC" type="xs:decimal" minOccurs="0" />
              <xs:element name="VALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVALOR" msprop:Generator_ColumnPropNameInRow="VALOR" msprop:Generator_ColumnPropNameInTable="VALORColumn" msprop:Generator_UserColumnName="VALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="NVENC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNVENC" msprop:Generator_ColumnPropNameInRow="NVENC" msprop:Generator_ColumnPropNameInTable="NVENCColumn" msprop:Generator_UserColumnName="NVENC" type="xs:decimal" minOccurs="0" />
              <xs:element name="DIAVALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDIAVALOR" msprop:Generator_ColumnPropNameInRow="DIAVALOR" msprop:Generator_ColumnPropNameInTable="DIAVALORColumn" msprop:Generator_UserColumnName="DIAVALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="D30" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD30" msprop:Generator_ColumnPropNameInRow="D30" msprop:Generator_ColumnPropNameInTable="D30Column" msprop:Generator_UserColumnName="D30" type="xs:decimal" minOccurs="0" />
              <xs:element name="D45" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD45" msprop:Generator_ColumnPropNameInRow="D45" msprop:Generator_ColumnPropNameInTable="D45Column" msprop:Generator_UserColumnName="D45" type="xs:decimal" minOccurs="0" />
              <xs:element name="D60" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD60" msprop:Generator_ColumnPropNameInRow="D60" msprop:Generator_ColumnPropNameInTable="D60Column" msprop:Generator_UserColumnName="D60" type="xs:decimal" minOccurs="0" />
              <xs:element name="D90" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD90" msprop:Generator_ColumnPropNameInRow="D90" msprop:Generator_ColumnPropNameInTable="D90Column" msprop:Generator_UserColumnName="D90" type="xs:decimal" minOccurs="0" />
              <xs:element name="D120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD120" msprop:Generator_ColumnPropNameInRow="D120" msprop:Generator_ColumnPropNameInTable="D120Column" msprop:Generator_UserColumnName="D120" type="xs:decimal" minOccurs="0" />
              <xs:element name="DM120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDM120" msprop:Generator_ColumnPropNameInRow="DM120" msprop:Generator_ColumnPropNameInTable="DM120Column" msprop:Generator_UserColumnName="DM120" type="xs:decimal" minOccurs="0" />
              <xs:element name="MdPagammentoDesc" msprop:Generator_ColumnVarNameInTable="columnMdPagammentoDesc" msprop:Generator_ColumnPropNameInRow="MdPagammentoDesc" msprop:Generator_ColumnPropNameInTable="MdPagammentoDescColumn" msprop:Generator_UserColumnName="MdPagammentoDesc" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RIDebitosVendedorDetalhado" msprop:Generator_TableClassName="RIDebitosVendedorDetalhadoDataTable" msprop:Generator_TableVarName="tableRIDebitosVendedorDetalhado" msprop:Generator_RowChangedName="RIDebitosVendedorDetalhadoRowChanged" msprop:Generator_TablePropName="RIDebitosVendedorDetalhado" msprop:Generator_RowDeletingName="RIDebitosVendedorDetalhadoRowDeleting" msprop:Generator_RowChangingName="RIDebitosVendedorDetalhadoRowChanging" msprop:Generator_RowEvHandlerName="RIDebitosVendedorDetalhadoRowChangeEventHandler" msprop:Generator_RowDeletedName="RIDebitosVendedorDetalhadoRowDeleted" msprop:Generator_RowClassName="RIDebitosVendedorDetalhadoRow" msprop:Generator_UserTableName="RIDebitosVendedorDetalhado" msprop:Generator_RowEvArgName="RIDebitosVendedorDetalhadoRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="No_" msprop:Generator_ColumnVarNameInTable="columnNo_" msprop:Generator_ColumnPropNameInRow="No_" msprop:Generator_ColumnPropNameInTable="No_Column" msprop:Generator_UserColumnName="No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="NVENC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNVENC" msprop:Generator_ColumnPropNameInRow="NVENC" msprop:Generator_ColumnPropNameInTable="NVENCColumn" msprop:Generator_UserColumnName="NVENC" type="xs:decimal" minOccurs="0" />
              <xs:element name="VALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVALOR" msprop:Generator_ColumnPropNameInRow="VALOR" msprop:Generator_ColumnPropNameInTable="VALORColumn" msprop:Generator_UserColumnName="VALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="D30" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD30" msprop:Generator_ColumnPropNameInRow="D30" msprop:Generator_ColumnPropNameInTable="D30Column" msprop:Generator_UserColumnName="D30" type="xs:decimal" minOccurs="0" />
              <xs:element name="DM120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDM120" msprop:Generator_ColumnPropNameInRow="DM120" msprop:Generator_ColumnPropNameInTable="DM120Column" msprop:Generator_UserColumnName="DM120" type="xs:decimal" minOccurs="0" />
              <xs:element name="D120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD120" msprop:Generator_ColumnPropNameInRow="D120" msprop:Generator_ColumnPropNameInTable="D120Column" msprop:Generator_UserColumnName="D120" type="xs:decimal" minOccurs="0" />
              <xs:element name="D90" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD90" msprop:Generator_ColumnPropNameInRow="D90" msprop:Generator_ColumnPropNameInTable="D90Column" msprop:Generator_UserColumnName="D90" type="xs:decimal" minOccurs="0" />
              <xs:element name="D60" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD60" msprop:Generator_ColumnPropNameInRow="D60" msprop:Generator_ColumnPropNameInTable="D60Column" msprop:Generator_UserColumnName="D60" type="xs:decimal" minOccurs="0" />
              <xs:element name="D45" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD45" msprop:Generator_ColumnPropNameInRow="D45" msprop:Generator_ColumnPropNameInTable="D45Column" msprop:Generator_UserColumnName="D45" type="xs:decimal" minOccurs="0" />
              <xs:element name="DIAVALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDIAVALOR" msprop:Generator_ColumnPropNameInRow="DIAVALOR" msprop:Generator_ColumnPropNameInTable="DIAVALORColumn" msprop:Generator_UserColumnName="DIAVALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="CRDINT" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCRDINT" msprop:Generator_ColumnPropNameInRow="CRDINT" msprop:Generator_ColumnPropNameInTable="CRDINTColumn" msprop:Generator_UserColumnName="CRDINT" type="xs:decimal" minOccurs="0" />
              <xs:element name="COSEC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCOSEC" msprop:Generator_ColumnPropNameInRow="COSEC" msprop:Generator_ColumnPropNameInTable="COSECColumn" msprop:Generator_UserColumnName="COSEC" type="xs:decimal" minOccurs="0" />
              <xs:element name="Search_x0020_Name" msprop:Generator_ColumnVarNameInTable="columnSearch_Name" msprop:Generator_ColumnPropNameInRow="Search_Name" msprop:Generator_ColumnPropNameInTable="Search_NameColumn" msprop:Generator_UserColumnName="Search Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="VendedorDesc" msprop:Generator_ColumnVarNameInTable="columnVendedorDesc" msprop:Generator_ColumnPropNameInRow="VendedorDesc" msprop:Generator_ColumnPropNameInTable="VendedorDescColumn" msprop:Generator_UserColumnName="VendedorDesc" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Document_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnDocument_No_" msprop:Generator_ColumnPropNameInRow="Document_No_" msprop:Generator_ColumnPropNameInTable="Document_No_Column" msprop:Generator_UserColumnName="Document No_">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Datadoc" msprop:Generator_ColumnVarNameInTable="columnDatadoc" msprop:Generator_ColumnPropNameInRow="Datadoc" msprop:Generator_ColumnPropNameInTable="DatadocColumn" msprop:Generator_UserColumnName="Datadoc" type="xs:dateTime" minOccurs="0" />
              <xs:element name="DataVencimento" msprop:Generator_ColumnVarNameInTable="columnDataVencimento" msprop:Generator_ColumnPropNameInRow="DataVencimento" msprop:Generator_ColumnPropNameInTable="DataVencimentoColumn" msprop:Generator_UserColumnName="DataVencimento" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Blocked" msprop:Generator_ColumnVarNameInTable="columnBlocked" msprop:Generator_ColumnPropNameInRow="Blocked" msprop:Generator_ColumnPropNameInTable="BlockedColumn" msprop:Generator_UserColumnName="Blocked" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RLetrasAberto" msprop:Generator_TableClassName="RLetrasAbertoDataTable" msprop:Generator_TableVarName="tableRLetrasAberto" msprop:Generator_RowChangedName="RLetrasAbertoRowChanged" msprop:Generator_TablePropName="RLetrasAberto" msprop:Generator_RowDeletingName="RLetrasAbertoRowDeleting" msprop:Generator_RowChangingName="RLetrasAbertoRowChanging" msprop:Generator_RowEvHandlerName="RLetrasAbertoRowChangeEventHandler" msprop:Generator_RowDeletedName="RLetrasAbertoRowDeleted" msprop:Generator_RowClassName="RLetrasAbertoRow" msprop:Generator_UserTableName="RLetrasAberto" msprop:Generator_RowEvArgName="RLetrasAbertoRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="No_" msprop:Generator_ColumnVarNameInTable="columnNo_" msprop:Generator_ColumnPropNameInRow="No_" msprop:Generator_ColumnPropNameInTable="No_Column" msprop:Generator_UserColumnName="No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Company" msprop:Generator_ColumnVarNameInTable="columnCompany" msprop:Generator_ColumnPropNameInRow="Company" msprop:Generator_ColumnPropNameInTable="CompanyColumn" msprop:Generator_UserColumnName="Company" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Search_x0020_Name" msprop:Generator_ColumnVarNameInTable="columnSearch_Name" msprop:Generator_ColumnPropNameInRow="Search_Name" msprop:Generator_ColumnPropNameInTable="Search_NameColumn" msprop:Generator_UserColumnName="Search Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Document_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnDocument_No_" msprop:Generator_ColumnPropNameInRow="Document_No_" msprop:Generator_ColumnPropNameInTable="Document_No_Column" msprop:Generator_UserColumnName="Document No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="TITULO" msprop:Generator_ColumnVarNameInTable="columnTITULO" msprop:Generator_ColumnPropNameInRow="TITULO" msprop:Generator_ColumnPropNameInTable="TITULOColumn" msprop:Generator_UserColumnName="TITULO" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Remaining_x0020_Amount_x0020__x0028_LCY_x0029__x0020_stats_" msprop:Generator_ColumnVarNameInTable="_columnRemaining_Amount__LCY__stats_" msprop:Generator_ColumnPropNameInRow="_Remaining_Amount__LCY__stats_" msprop:Generator_ColumnPropNameInTable="_Remaining_Amount__LCY__stats_Column" msprop:Generator_UserColumnName="Remaining Amount (LCY) stats_" type="xs:decimal" minOccurs="0" />
              <xs:element name="Customer_x0020_Posting_x0020_Group" msprop:Generator_ColumnVarNameInTable="columnCustomer_Posting_Group" msprop:Generator_ColumnPropNameInRow="Customer_Posting_Group" msprop:Generator_ColumnPropNameInTable="Customer_Posting_GroupColumn" msprop:Generator_UserColumnName="Customer Posting Group" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Document_x0020_Date" msprop:Generator_ColumnVarNameInTable="columnDocument_Date" msprop:Generator_ColumnPropNameInRow="Document_Date" msprop:Generator_ColumnPropNameInTable="Document_DateColumn" msprop:Generator_UserColumnName="Document Date" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Due_x0020_Date" msprop:Generator_ColumnVarNameInTable="columnDue_Date" msprop:Generator_ColumnPropNameInRow="Due_Date" msprop:Generator_ColumnPropNameInTable="Due_DateColumn" msprop:Generator_UserColumnName="Due Date" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Bank_x0020_Account_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnBank_Account_No_" msprop:Generator_ColumnPropNameInRow="Bank_Account_No_" msprop:Generator_ColumnPropNameInTable="Bank_Account_No_Column" msprop:Generator_UserColumnName="Bank Account No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="DIAS" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDIAS" msprop:Generator_ColumnPropNameInRow="DIAS" msprop:Generator_ColumnPropNameInTable="DIASColumn" msprop:Generator_UserColumnName="DIAS" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RCoberturaCosec" msprop:Generator_TableClassName="RCoberturaCosecDataTable" msprop:Generator_TableVarName="tableRCoberturaCosec" msprop:Generator_TablePropName="RCoberturaCosec" msprop:Generator_RowDeletingName="RCoberturaCosecRowDeleting" msprop:Generator_RowChangingName="RCoberturaCosecRowChanging" msprop:Generator_RowEvHandlerName="RCoberturaCosecRowChangeEventHandler" msprop:Generator_RowDeletedName="RCoberturaCosecRowDeleted" msprop:Generator_UserTableName="RCoberturaCosec" msprop:Generator_RowChangedName="RCoberturaCosecRowChanged" msprop:Generator_RowEvArgName="RCoberturaCosecRowChangeEvent" msprop:Generator_RowClassName="RCoberturaCosecRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="No_" msprop:Generator_ColumnVarNameInTable="columnNo_" msprop:Generator_ColumnPropNameInRow="No_" msprop:Generator_ColumnPropNameInTable="No_Column" msprop:Generator_UserColumnName="No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="NVENC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNVENC" msprop:Generator_ColumnPropNameInRow="NVENC" msprop:Generator_ColumnPropNameInTable="NVENCColumn" msprop:Generator_UserColumnName="NVENC" type="xs:decimal" minOccurs="0" />
              <xs:element name="VALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVALOR" msprop:Generator_ColumnPropNameInRow="VALOR" msprop:Generator_ColumnPropNameInTable="VALORColumn" msprop:Generator_UserColumnName="VALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="D30" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD30" msprop:Generator_ColumnPropNameInRow="D30" msprop:Generator_ColumnPropNameInTable="D30Column" msprop:Generator_UserColumnName="D30" type="xs:decimal" minOccurs="0" />
              <xs:element name="DM120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDM120" msprop:Generator_ColumnPropNameInRow="DM120" msprop:Generator_ColumnPropNameInTable="DM120Column" msprop:Generator_UserColumnName="DM120" type="xs:decimal" minOccurs="0" />
              <xs:element name="D120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD120" msprop:Generator_ColumnPropNameInRow="D120" msprop:Generator_ColumnPropNameInTable="D120Column" msprop:Generator_UserColumnName="D120" type="xs:decimal" minOccurs="0" />
              <xs:element name="D90" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD90" msprop:Generator_ColumnPropNameInRow="D90" msprop:Generator_ColumnPropNameInTable="D90Column" msprop:Generator_UserColumnName="D90" type="xs:decimal" minOccurs="0" />
              <xs:element name="D60" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD60" msprop:Generator_ColumnPropNameInRow="D60" msprop:Generator_ColumnPropNameInTable="D60Column" msprop:Generator_UserColumnName="D60" type="xs:decimal" minOccurs="0" />
              <xs:element name="D45" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD45" msprop:Generator_ColumnPropNameInRow="D45" msprop:Generator_ColumnPropNameInTable="D45Column" msprop:Generator_UserColumnName="D45" type="xs:decimal" minOccurs="0" />
              <xs:element name="DIAVALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDIAVALOR" msprop:Generator_ColumnPropNameInRow="DIAVALOR" msprop:Generator_ColumnPropNameInTable="DIAVALORColumn" msprop:Generator_UserColumnName="DIAVALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="CRDINT" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCRDINT" msprop:Generator_ColumnPropNameInRow="CRDINT" msprop:Generator_ColumnPropNameInTable="CRDINTColumn" msprop:Generator_UserColumnName="CRDINT" type="xs:decimal" minOccurs="0" />
              <xs:element name="COSEC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCOSEC" msprop:Generator_ColumnPropNameInRow="COSEC" msprop:Generator_ColumnPropNameInTable="COSECColumn" msprop:Generator_UserColumnName="COSEC" type="xs:decimal" minOccurs="0" />
              <xs:element name="Search_x0020_Name" msprop:Generator_ColumnVarNameInTable="columnSearch_Name" msprop:Generator_ColumnPropNameInRow="Search_Name" msprop:Generator_ColumnPropNameInTable="Search_NameColumn" msprop:Generator_UserColumnName="Search Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="VendedorDesc" msprop:Generator_ColumnVarNameInTable="columnVendedorDesc" msprop:Generator_ColumnPropNameInRow="VendedorDesc" msprop:Generator_ColumnPropNameInTable="VendedorDescColumn" msprop:Generator_UserColumnName="VendedorDesc" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RLetrasParaAceite" msprop:Generator_TableClassName="RLetrasParaAceiteDataTable" msprop:Generator_TableVarName="tableRLetrasParaAceite" msprop:Generator_RowChangedName="RLetrasParaAceiteRowChanged" msprop:Generator_TablePropName="RLetrasParaAceite" msprop:Generator_RowDeletingName="RLetrasParaAceiteRowDeleting" msprop:Generator_RowChangingName="RLetrasParaAceiteRowChanging" msprop:Generator_RowEvHandlerName="RLetrasParaAceiteRowChangeEventHandler" msprop:Generator_RowDeletedName="RLetrasParaAceiteRowDeleted" msprop:Generator_RowClassName="RLetrasParaAceiteRow" msprop:Generator_UserTableName="RLetrasParaAceite" msprop:Generator_RowEvArgName="RLetrasParaAceiteRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Customer_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnCustomer_No_" msprop:Generator_ColumnPropNameInRow="Customer_No_" msprop:Generator_ColumnPropNameInTable="Customer_No_Column" msprop:Generator_UserColumnName="Customer No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="No_" msprop:Generator_ColumnVarNameInTable="columnNo_" msprop:Generator_ColumnPropNameInRow="No_" msprop:Generator_ColumnPropNameInTable="No_Column" msprop:Generator_UserColumnName="No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Posting_x0020_Date" msprop:Generator_ColumnVarNameInTable="columnPosting_Date" msprop:Generator_ColumnPropNameInRow="Posting_Date" msprop:Generator_ColumnPropNameInTable="Posting_DateColumn" msprop:Generator_UserColumnName="Posting Date" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Due_x0020_Date" msprop:Generator_ColumnVarNameInTable="columnDue_Date" msprop:Generator_ColumnPropNameInRow="Due_Date" msprop:Generator_ColumnPropNameInTable="Due_DateColumn" msprop:Generator_UserColumnName="Due Date" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Accepted" msprop:Generator_ColumnVarNameInTable="columnAccepted" msprop:Generator_ColumnPropNameInRow="Accepted" msprop:Generator_ColumnPropNameInTable="AcceptedColumn" msprop:Generator_UserColumnName="Accepted" type="xs:int" minOccurs="0" />
              <xs:element name="Remaining_x0020_Amount" msprop:Generator_ColumnVarNameInTable="columnRemaining_Amount" msprop:Generator_ColumnPropNameInRow="Remaining_Amount" msprop:Generator_ColumnPropNameInTable="Remaining_AmountColumn" msprop:Generator_UserColumnName="Remaining Amount" type="xs:decimal" minOccurs="0" />
              <xs:element name="Search_x0020_Name" msprop:Generator_ColumnVarNameInTable="columnSearch_Name" msprop:Generator_ColumnPropNameInRow="Search_Name" msprop:Generator_ColumnPropNameInTable="Search_NameColumn" msprop:Generator_UserColumnName="Search Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RLetrasCarteira" msprop:Generator_TableClassName="RLetrasCarteiraDataTable" msprop:Generator_TableVarName="tableRLetrasCarteira" msprop:Generator_RowChangedName="RLetrasCarteiraRowChanged" msprop:Generator_TablePropName="RLetrasCarteira" msprop:Generator_RowDeletingName="RLetrasCarteiraRowDeleting" msprop:Generator_RowChangingName="RLetrasCarteiraRowChanging" msprop:Generator_RowEvHandlerName="RLetrasCarteiraRowChangeEventHandler" msprop:Generator_RowDeletedName="RLetrasCarteiraRowDeleted" msprop:Generator_RowClassName="RLetrasCarteiraRow" msprop:Generator_UserTableName="RLetrasCarteira" msprop:Generator_RowEvArgName="RLetrasCarteiraRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Customer_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnCustomer_No_" msprop:Generator_ColumnPropNameInRow="Customer_No_" msprop:Generator_ColumnPropNameInTable="Customer_No_Column" msprop:Generator_UserColumnName="Customer No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Document_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnDocument_No_" msprop:Generator_ColumnPropNameInRow="Document_No_" msprop:Generator_ColumnPropNameInTable="Document_No_Column" msprop:Generator_UserColumnName="Document No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="No_" msprop:Generator_ColumnVarNameInTable="columnNo_" msprop:Generator_ColumnPropNameInRow="No_" msprop:Generator_ColumnPropNameInTable="No_Column" msprop:Generator_UserColumnName="No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Posting_x0020_Date" msprop:Generator_ColumnVarNameInTable="columnPosting_Date" msprop:Generator_ColumnPropNameInRow="Posting_Date" msprop:Generator_ColumnPropNameInTable="Posting_DateColumn" msprop:Generator_UserColumnName="Posting Date" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Due_x0020_Date" msprop:Generator_ColumnVarNameInTable="columnDue_Date" msprop:Generator_ColumnPropNameInRow="Due_Date" msprop:Generator_ColumnPropNameInTable="Due_DateColumn" msprop:Generator_UserColumnName="Due Date" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Remaining_x0020_Amount" msprop:Generator_ColumnVarNameInTable="columnRemaining_Amount" msprop:Generator_ColumnPropNameInRow="Remaining_Amount" msprop:Generator_ColumnPropNameInTable="Remaining_AmountColumn" msprop:Generator_UserColumnName="Remaining Amount" type="xs:decimal" minOccurs="0" />
              <xs:element name="Search_x0020_Name" msprop:Generator_ColumnVarNameInTable="columnSearch_Name" msprop:Generator_ColumnPropNameInRow="Search_Name" msprop:Generator_ColumnPropNameInTable="Search_NameColumn" msprop:Generator_UserColumnName="Search Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RLetrasClientes" msprop:Generator_TableClassName="RLetrasClientesDataTable" msprop:Generator_TableVarName="tableRLetrasClientes" msprop:Generator_RowChangedName="RLetrasClientesRowChanged" msprop:Generator_TablePropName="RLetrasClientes" msprop:Generator_RowDeletingName="RLetrasClientesRowDeleting" msprop:Generator_RowChangingName="RLetrasClientesRowChanging" msprop:Generator_RowEvHandlerName="RLetrasClientesRowChangeEventHandler" msprop:Generator_RowDeletedName="RLetrasClientesRowDeleted" msprop:Generator_RowClassName="RLetrasClientesRow" msprop:Generator_UserTableName="RLetrasClientes" msprop:Generator_RowEvArgName="RLetrasClientesRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Customer_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnCustomer_No_" msprop:Generator_ColumnPropNameInRow="Customer_No_" msprop:Generator_ColumnPropNameInTable="Customer_No_Column" msprop:Generator_UserColumnName="Customer No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Posting_x0020_Date" msprop:Generator_ColumnVarNameInTable="columnPosting_Date" msprop:Generator_ColumnPropNameInRow="Posting_Date" msprop:Generator_ColumnPropNameInTable="Posting_DateColumn" msprop:Generator_UserColumnName="Posting Date" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Document_x0020_Type" msprop:Generator_ColumnVarNameInTable="columnDocument_Type" msprop:Generator_ColumnPropNameInRow="Document_Type" msprop:Generator_ColumnPropNameInTable="Document_TypeColumn" msprop:Generator_UserColumnName="Document Type" type="xs:int" minOccurs="0" />
              <xs:element name="Letra" msprop:Generator_ColumnVarNameInTable="columnLetra" msprop:Generator_ColumnPropNameInRow="Letra" msprop:Generator_ColumnPropNameInTable="LetraColumn" msprop:Generator_UserColumnName="Letra" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Factura" msprop:Generator_ColumnVarNameInTable="columnFactura" msprop:Generator_ColumnPropNameInRow="Factura" msprop:Generator_ColumnPropNameInTable="FacturaColumn" msprop:Generator_UserColumnName="Factura" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="VencFactura" msprop:Generator_ColumnVarNameInTable="columnVencFactura" msprop:Generator_ColumnPropNameInRow="VencFactura" msprop:Generator_ColumnPropNameInTable="VencFacturaColumn" msprop:Generator_UserColumnName="VencFactura" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Amount_x0020__x0028_LCY_x0029__x0020_stats_" msprop:Generator_ColumnVarNameInTable="_columnAmount__LCY__stats_" msprop:Generator_ColumnPropNameInRow="_Amount__LCY__stats_" msprop:Generator_ColumnPropNameInTable="_Amount__LCY__stats_Column" msprop:Generator_UserColumnName="Amount (LCY) stats_" type="xs:decimal" minOccurs="0" />
              <xs:element name="Search_x0020_Name" msprop:Generator_ColumnVarNameInTable="columnSearch_Name" msprop:Generator_ColumnPropNameInRow="Search_Name" msprop:Generator_ColumnPropNameInTable="Search_NameColumn" msprop:Generator_UserColumnName="Search Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Code" msprop:Generator_ColumnVarNameInTable="columnCode" msprop:Generator_ColumnPropNameInRow="Code" msprop:Generator_ColumnPropNameInTable="CodeColumn" msprop:Generator_UserColumnName="Code">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Description" msprop:Generator_ColumnVarNameInTable="columnDescription" msprop:Generator_ColumnPropNameInRow="Description" msprop:Generator_ColumnPropNameInTable="DescriptionColumn" msprop:Generator_UserColumnName="Description" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RLetrasDescontadas" msprop:Generator_TableClassName="RLetrasDescontadasDataTable" msprop:Generator_TableVarName="tableRLetrasDescontadas" msprop:Generator_RowChangedName="RLetrasDescontadasRowChanged" msprop:Generator_TablePropName="RLetrasDescontadas" msprop:Generator_RowDeletingName="RLetrasDescontadasRowDeleting" msprop:Generator_RowChangingName="RLetrasDescontadasRowChanging" msprop:Generator_RowEvHandlerName="RLetrasDescontadasRowChangeEventHandler" msprop:Generator_RowDeletedName="RLetrasDescontadasRowDeleted" msprop:Generator_RowClassName="RLetrasDescontadasRow" msprop:Generator_UserTableName="RLetrasDescontadas" msprop:Generator_RowEvArgName="RLetrasDescontadasRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Account_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnAccount_No_" msprop:Generator_ColumnPropNameInRow="Account_No_" msprop:Generator_ColumnPropNameInTable="Account_No_Column" msprop:Generator_UserColumnName="Account No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Search_x0020_Name" msprop:Generator_ColumnVarNameInTable="columnSearch_Name" msprop:Generator_ColumnPropNameInRow="Search_Name" msprop:Generator_ColumnPropNameInTable="Search_NameColumn" msprop:Generator_UserColumnName="Search Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Document_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnDocument_No_" msprop:Generator_ColumnPropNameInRow="Document_No_" msprop:Generator_ColumnPropNameInTable="Document_No_Column" msprop:Generator_UserColumnName="Document No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="No_" msprop:Generator_ColumnVarNameInTable="columnNo_" msprop:Generator_ColumnPropNameInRow="No_" msprop:Generator_ColumnPropNameInTable="No_Column" msprop:Generator_UserColumnName="No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Posting_x0020_Date" msprop:Generator_ColumnVarNameInTable="columnPosting_Date" msprop:Generator_ColumnPropNameInRow="Posting_Date" msprop:Generator_ColumnPropNameInTable="Posting_DateColumn" msprop:Generator_UserColumnName="Posting Date" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Due_x0020_Date" msprop:Generator_ColumnVarNameInTable="columnDue_Date" msprop:Generator_ColumnPropNameInRow="Due_Date" msprop:Generator_ColumnPropNameInTable="Due_DateColumn" msprop:Generator_UserColumnName="Due Date" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Remaining_x0020_Amt__x0020__x0028_LCY_x0029_" msprop:Generator_ColumnVarNameInTable="_columnRemaining_Amt___LCY_" msprop:Generator_ColumnPropNameInRow="_Remaining_Amt___LCY_" msprop:Generator_ColumnPropNameInTable="_Remaining_Amt___LCY_Column" msprop:Generator_UserColumnName="Remaining Amt_ (LCY)" type="xs:decimal" minOccurs="0" />
              <xs:element name="Bank_x0020_Account_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnBank_Account_No_" msprop:Generator_ColumnPropNameInRow="Bank_Account_No_" msprop:Generator_ColumnPropNameInTable="Bank_Account_No_Column" msprop:Generator_UserColumnName="Bank Account No_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="BankDesc" msprop:Generator_ColumnVarNameInTable="columnBankDesc" msprop:Generator_ColumnPropNameInRow="BankDesc" msprop:Generator_ColumnPropNameInTable="BankDescColumn" msprop:Generator_UserColumnName="BankDesc" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Dashboard" msprop:Generator_TableClassName="DashboardDataTable" msprop:Generator_TableVarName="tableDashboard" msprop:Generator_TablePropName="Dashboard" msprop:Generator_RowDeletingName="DashboardRowDeleting" msprop:Generator_RowChangingName="DashboardRowChanging" msprop:Generator_RowEvHandlerName="DashboardRowChangeEventHandler" msprop:Generator_RowDeletedName="DashboardRowDeleted" msprop:Generator_UserTableName="Dashboard" msprop:Generator_RowChangedName="DashboardRowChanged" msprop:Generator_RowEvArgName="DashboardRowChangeEvent" msprop:Generator_RowClassName="DashboardRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="NVENC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNVENC" msprop:Generator_ColumnPropNameInRow="NVENC" msprop:Generator_ColumnPropNameInTable="NVENCColumn" msprop:Generator_UserColumnName="NVENC" type="xs:decimal" minOccurs="0" />
              <xs:element name="VALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVALOR" msprop:Generator_ColumnPropNameInRow="VALOR" msprop:Generator_ColumnPropNameInTable="VALORColumn" msprop:Generator_UserColumnName="VALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="VENCIDO" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVENCIDO" msprop:Generator_ColumnPropNameInRow="VENCIDO" msprop:Generator_ColumnPropNameInTable="VENCIDOColumn" msprop:Generator_UserColumnName="VENCIDO" type="xs:decimal" minOccurs="0" />
              <xs:element name="MesDesc" msprop:Generator_ColumnVarNameInTable="columnMesDesc" msprop:Generator_ColumnPropNameInRow="MesDesc" msprop:Generator_ColumnPropNameInTable="MesDescColumn" msprop:Generator_UserColumnName="MesDesc" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Mes" msprop:Generator_ColumnVarNameInTable="columnMes" msprop:Generator_ColumnPropNameInRow="Mes" msprop:Generator_ColumnPropNameInTable="MesColumn" msprop:Generator_UserColumnName="Mes" type="xs:int" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="dboardIDebitos" msprop:Generator_TableClassName="dboardIDebitosDataTable" msprop:Generator_TableVarName="tabledboardIDebitos" msprop:Generator_TablePropName="dboardIDebitos" msprop:Generator_RowDeletingName="dboardIDebitosRowDeleting" msprop:Generator_RowChangingName="dboardIDebitosRowChanging" msprop:Generator_RowEvHandlerName="dboardIDebitosRowChangeEventHandler" msprop:Generator_RowDeletedName="dboardIDebitosRowDeleted" msprop:Generator_UserTableName="dboardIDebitos" msprop:Generator_RowChangedName="dboardIDebitosRowChanged" msprop:Generator_RowEvArgName="dboardIDebitosRowChangeEvent" msprop:Generator_RowClassName="dboardIDebitosRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Customer_x0020_Posting_x0020_Group" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCustomer_Posting_Group" msprop:Generator_ColumnPropNameInRow="Customer_Posting_Group" msprop:Generator_ColumnPropNameInTable="Customer_Posting_GroupColumn" msprop:Generator_UserColumnName="Customer Posting Group" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="5" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="NVENC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNVENC" msprop:Generator_ColumnPropNameInRow="NVENC" msprop:Generator_ColumnPropNameInTable="NVENCColumn" msprop:Generator_UserColumnName="NVENC" type="xs:decimal" minOccurs="0" />
              <xs:element name="VALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVALOR" msprop:Generator_ColumnPropNameInRow="VALOR" msprop:Generator_ColumnPropNameInTable="VALORColumn" msprop:Generator_UserColumnName="VALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="D30" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD30" msprop:Generator_ColumnPropNameInRow="D30" msprop:Generator_ColumnPropNameInTable="D30Column" msprop:Generator_UserColumnName="D30" type="xs:decimal" minOccurs="0" />
              <xs:element name="DM120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDM120" msprop:Generator_ColumnPropNameInRow="DM120" msprop:Generator_ColumnPropNameInTable="DM120Column" msprop:Generator_UserColumnName="DM120" type="xs:decimal" minOccurs="0" />
              <xs:element name="D120" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD120" msprop:Generator_ColumnPropNameInRow="D120" msprop:Generator_ColumnPropNameInTable="D120Column" msprop:Generator_UserColumnName="D120" type="xs:decimal" minOccurs="0" />
              <xs:element name="D90" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD90" msprop:Generator_ColumnPropNameInRow="D90" msprop:Generator_ColumnPropNameInTable="D90Column" msprop:Generator_UserColumnName="D90" type="xs:decimal" minOccurs="0" />
              <xs:element name="D60" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD60" msprop:Generator_ColumnPropNameInRow="D60" msprop:Generator_ColumnPropNameInTable="D60Column" msprop:Generator_UserColumnName="D60" type="xs:decimal" minOccurs="0" />
              <xs:element name="D45" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnD45" msprop:Generator_ColumnPropNameInRow="D45" msprop:Generator_ColumnPropNameInTable="D45Column" msprop:Generator_UserColumnName="D45" type="xs:decimal" minOccurs="0" />
              <xs:element name="DIAVALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDIAVALOR" msprop:Generator_ColumnPropNameInRow="DIAVALOR" msprop:Generator_ColumnPropNameInTable="DIAVALORColumn" msprop:Generator_UserColumnName="DIAVALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="CRDINT" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCRDINT" msprop:Generator_ColumnPropNameInRow="CRDINT" msprop:Generator_ColumnPropNameInTable="CRDINTColumn" msprop:Generator_UserColumnName="CRDINT" type="xs:decimal" minOccurs="0" />
              <xs:element name="COSEC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCOSEC" msprop:Generator_ColumnPropNameInRow="COSEC" msprop:Generator_ColumnPropNameInTable="COSECColumn" msprop:Generator_UserColumnName="COSEC" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="DataTable1" msprop:Generator_TableClassName="DataTable1DataTable" msprop:Generator_TableVarName="tableDataTable1" msprop:Generator_RowChangedName="DataTable1RowChanged" msprop:Generator_TablePropName="DataTable1" msprop:Generator_RowDeletingName="DataTable1RowDeleting" msprop:Generator_RowChangingName="DataTable1RowChanging" msprop:Generator_RowEvHandlerName="DataTable1RowChangeEventHandler" msprop:Generator_RowDeletedName="DataTable1RowDeleted" msprop:Generator_RowClassName="DataTable1Row" msprop:Generator_UserTableName="DataTable1" msprop:Generator_RowEvArgName="DataTable1RowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Idade" msprop:Generator_ColumnVarNameInTable="columnIdade" msprop:Generator_ColumnPropNameInRow="Idade" msprop:Generator_ColumnPropNameInTable="IdadeColumn" msprop:Generator_UserColumnName="Idade" type="xs:string" minOccurs="0" />
              <xs:element name="Montante" msprop:Generator_ColumnVarNameInTable="columnMontante" msprop:Generator_ColumnPropNameInRow="Montante" msprop:Generator_ColumnPropNameInTable="MontanteColumn" msprop:Generator_UserColumnName="Montante" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="dboardAntiguidadeSaldo" msprop:Generator_TableClassName="dboardAntiguidadeSaldoDataTable" msprop:Generator_TableVarName="tabledboardAntiguidadeSaldo" msprop:Generator_TablePropName="dboardAntiguidadeSaldo" msprop:Generator_RowDeletingName="dboardAntiguidadeSaldoRowDeleting" msprop:Generator_RowChangingName="dboardAntiguidadeSaldoRowChanging" msprop:Generator_RowEvHandlerName="dboardAntiguidadeSaldoRowChangeEventHandler" msprop:Generator_RowDeletedName="dboardAntiguidadeSaldoRowDeleted" msprop:Generator_UserTableName="dboardAntiguidadeSaldo" msprop:Generator_RowChangedName="dboardAntiguidadeSaldoRowChanged" msprop:Generator_RowEvArgName="dboardAntiguidadeSaldoRowChangeEvent" msprop:Generator_RowClassName="dboardAntiguidadeSaldoRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="DIAS" msprop:Generator_ColumnVarNameInTable="columnDIAS" msprop:Generator_ColumnPropNameInRow="DIAS" msprop:Generator_ColumnPropNameInTable="DIASColumn" msprop:Generator_UserColumnName="DIAS" type="xs:int" minOccurs="0" />
              <xs:element name="data" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columndata" msprop:Generator_ColumnPropNameInRow="data" msprop:Generator_ColumnPropNameInTable="dataColumn" msprop:Generator_UserColumnName="data" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Document_x0020_Type" msprop:Generator_ColumnVarNameInTable="columnDocument_Type" msprop:Generator_ColumnPropNameInRow="Document_Type" msprop:Generator_ColumnPropNameInTable="Document_TypeColumn" msprop:Generator_UserColumnName="Document Type" type="xs:int" minOccurs="0" />
              <xs:element name="MES" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnMES" msprop:Generator_ColumnPropNameInRow="MES" msprop:Generator_ColumnPropNameInTable="MESColumn" msprop:Generator_UserColumnName="MES" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="dboardMDA" msprop:Generator_TableClassName="dboardMDADataTable" msprop:Generator_TableVarName="tabledboardMDA" msprop:Generator_RowChangedName="dboardMDARowChanged" msprop:Generator_TablePropName="dboardMDA" msprop:Generator_RowDeletingName="dboardMDARowDeleting" msprop:Generator_RowChangingName="dboardMDARowChanging" msprop:Generator_RowEvHandlerName="dboardMDARowChangeEventHandler" msprop:Generator_RowDeletedName="dboardMDARowDeleted" msprop:Generator_RowClassName="dboardMDARow" msprop:Generator_UserTableName="dboardMDA" msprop:Generator_RowEvArgName="dboardMDARowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="VALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVALOR" msprop:Generator_ColumnPropNameInRow="VALOR" msprop:Generator_ColumnPropNameInTable="VALORColumn" msprop:Generator_UserColumnName="VALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="DIAVALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDIAVALOR" msprop:Generator_ColumnPropNameInRow="DIAVALOR" msprop:Generator_ColumnPropNameInTable="DIAVALORColumn" msprop:Generator_UserColumnName="DIAVALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="Expr1" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnExpr1" msprop:Generator_ColumnPropNameInRow="Expr1" msprop:Generator_ColumnPropNameInTable="Expr1Column" msprop:Generator_UserColumnName="Expr1" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="dboardMDVencimento" msprop:Generator_TableClassName="dboardMDVencimentoDataTable" msprop:Generator_TableVarName="tabledboardMDVencimento" msprop:Generator_RowChangedName="dboardMDVencimentoRowChanged" msprop:Generator_TablePropName="dboardMDVencimento" msprop:Generator_RowDeletingName="dboardMDVencimentoRowDeleting" msprop:Generator_RowChangingName="dboardMDVencimentoRowChanging" msprop:Generator_RowEvHandlerName="dboardMDVencimentoRowChangeEventHandler" msprop:Generator_RowDeletedName="dboardMDVencimentoRowDeleted" msprop:Generator_RowClassName="dboardMDVencimentoRow" msprop:Generator_UserTableName="dboardMDVencimento" msprop:Generator_RowEvArgName="dboardMDVencimentoRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="VALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVALOR" msprop:Generator_ColumnPropNameInRow="VALOR" msprop:Generator_ColumnPropNameInTable="VALORColumn" msprop:Generator_UserColumnName="VALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="DIAVALOR" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDIAVALOR" msprop:Generator_ColumnPropNameInRow="DIAVALOR" msprop:Generator_ColumnPropNameInTable="DIAVALORColumn" msprop:Generator_UserColumnName="DIAVALOR" type="xs:decimal" minOccurs="0" />
              <xs:element name="Expr1" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnExpr1" msprop:Generator_ColumnPropNameInRow="Expr1" msprop:Generator_ColumnPropNameInTable="Expr1Column" msprop:Generator_UserColumnName="Expr1" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RIDebitosAgrupado" msprop:Generator_TableClassName="RIDebitosAgrupadoDataTable" msprop:Generator_TableVarName="tableRIDebitosAgrupado" msprop:Generator_RowChangedName="RIDebitosAgrupadoRowChanged" msprop:Generator_TablePropName="RIDebitosAgrupado" msprop:Generator_RowDeletingName="RIDebitosAgrupadoRowDeleting" msprop:Generator_RowChangingName="RIDebitosAgrupadoRowChanging" msprop:Generator_RowEvHandlerName="RIDebitosAgrupadoRowChangeEventHandler" msprop:Generator_RowDeletedName="RIDebitosAgrupadoRowDeleted" msprop:Generator_RowClassName="RIDebitosAgrupadoRow" msprop:Generator_UserTableName="RIDebitosAgrupado" msprop:Generator_RowEvArgName="RIDebitosAgrupadoRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Customer_x0020_Posting_x0020_Group" msprop:Generator_ColumnVarNameInTable="columnCustomer_Posting_Group" msprop:Generator_ColumnPropNameInRow="Customer_Posting_Group" msprop:Generator_ColumnPropNameInTable="Customer_Posting_GroupColumn" msprop:Generator_UserColumnName="Customer Posting Group" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="NVenc" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNVenc" msprop:Generator_ColumnPropNameInRow="NVenc" msprop:Generator_ColumnPropNameInTable="NVencColumn" msprop:Generator_UserColumnName="NVenc" type="xs:decimal" minOccurs="0" />
              <xs:element name="Valor" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnValor" msprop:Generator_ColumnPropNameInRow="Valor" msprop:Generator_ColumnPropNameInTable="ValorColumn" msprop:Generator_UserColumnName="Valor" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x0033_0D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="column30D" msprop:Generator_ColumnPropNameInRow="_30D" msprop:Generator_ColumnPropNameInTable="_30DColumn" msprop:Generator_UserColumnName="30D" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x0034_5D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="column45D" msprop:Generator_ColumnPropNameInRow="_45D" msprop:Generator_ColumnPropNameInTable="_45DColumn" msprop:Generator_UserColumnName="45D" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x0036_0D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="column60D" msprop:Generator_ColumnPropNameInRow="_60D" msprop:Generator_ColumnPropNameInTable="_60DColumn" msprop:Generator_UserColumnName="60D" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x0039_0D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="column90D" msprop:Generator_ColumnPropNameInRow="_90D" msprop:Generator_ColumnPropNameInTable="_90DColumn" msprop:Generator_UserColumnName="90D" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x0031_20D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="column120D" msprop:Generator_ColumnPropNameInRow="_120D" msprop:Generator_ColumnPropNameInTable="_120DColumn" msprop:Generator_UserColumnName="120D" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x003E_120D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_column_120D" msprop:Generator_ColumnPropNameInRow="__120D" msprop:Generator_ColumnPropNameInTable="__120DColumn" msprop:Generator_UserColumnName="&gt;120D" type="xs:decimal" minOccurs="0" />
              <xs:element name="CosecCliente" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCosecCliente" msprop:Generator_ColumnPropNameInRow="CosecCliente" msprop:Generator_ColumnPropNameInTable="CosecClienteColumn" msprop:Generator_UserColumnName="CosecCliente" type="xs:decimal" minOccurs="0" />
              <xs:element name="CreditoInterno" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCreditoInterno" msprop:Generator_ColumnPropNameInRow="CreditoInterno" msprop:Generator_ColumnPropNameInTable="CreditoInternoColumn" msprop:Generator_UserColumnName="CreditoInterno" type="xs:decimal" minOccurs="0" />
              <xs:element name="DiasValor" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDiasValor" msprop:Generator_ColumnPropNameInRow="DiasValor" msprop:Generator_ColumnPropNameInTable="DiasValorColumn" msprop:Generator_UserColumnName="DiasValor" type="xs:decimal" minOccurs="0" />
              <xs:element name="MDA" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnMDA" msprop:Generator_ColumnPropNameInRow="MDA" msprop:Generator_ColumnPropNameInTable="MDAColumn" msprop:Generator_UserColumnName="MDA" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RIdebitosGeral" msprop:Generator_TableClassName="RIdebitosGeralDataTable" msprop:Generator_TableVarName="tableRIdebitosGeral" msprop:Generator_RowChangedName="RIdebitosGeralRowChanged" msprop:Generator_TablePropName="RIdebitosGeral" msprop:Generator_RowDeletingName="RIdebitosGeralRowDeleting" msprop:Generator_RowChangingName="RIdebitosGeralRowChanging" msprop:Generator_RowEvHandlerName="RIdebitosGeralRowChangeEventHandler" msprop:Generator_RowDeletedName="RIdebitosGeralRowDeleted" msprop:Generator_RowClassName="RIdebitosGeralRow" msprop:Generator_UserTableName="RIdebitosGeral" msprop:Generator_RowEvArgName="RIdebitosGeralRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Customer_x0020_No_" msprop:Generator_ColumnVarNameInTable="columnCustomer_No_" msprop:Generator_ColumnPropNameInRow="Customer_No_" msprop:Generator_ColumnPropNameInTable="Customer_No_Column" msprop:Generator_UserColumnName="Customer No_">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="NVenc" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNVenc" msprop:Generator_ColumnPropNameInRow="NVenc" msprop:Generator_ColumnPropNameInTable="NVencColumn" msprop:Generator_UserColumnName="NVenc" type="xs:decimal" minOccurs="0" />
              <xs:element name="Valor" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnValor" msprop:Generator_ColumnPropNameInRow="Valor" msprop:Generator_ColumnPropNameInTable="ValorColumn" msprop:Generator_UserColumnName="Valor" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x0033_0D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="column30D" msprop:Generator_ColumnPropNameInRow="_30D" msprop:Generator_ColumnPropNameInTable="_30DColumn" msprop:Generator_UserColumnName="30D" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x0034_5D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="column45D" msprop:Generator_ColumnPropNameInRow="_45D" msprop:Generator_ColumnPropNameInTable="_45DColumn" msprop:Generator_UserColumnName="45D" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x0036_0D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="column60D" msprop:Generator_ColumnPropNameInRow="_60D" msprop:Generator_ColumnPropNameInTable="_60DColumn" msprop:Generator_UserColumnName="60D" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x0039_0D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="column90D" msprop:Generator_ColumnPropNameInRow="_90D" msprop:Generator_ColumnPropNameInTable="_90DColumn" msprop:Generator_UserColumnName="90D" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x0031_20D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="column120D" msprop:Generator_ColumnPropNameInRow="_120D" msprop:Generator_ColumnPropNameInTable="_120DColumn" msprop:Generator_UserColumnName="120D" type="xs:decimal" minOccurs="0" />
              <xs:element name="_x003E_120D" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_column_120D" msprop:Generator_ColumnPropNameInRow="__120D" msprop:Generator_ColumnPropNameInTable="__120DColumn" msprop:Generator_UserColumnName="&gt;120D" type="xs:decimal" minOccurs="0" />
              <xs:element name="CredInt" msprop:Generator_ColumnVarNameInTable="columnCredInt" msprop:Generator_ColumnPropNameInRow="CredInt" msprop:Generator_ColumnPropNameInTable="CredIntColumn" msprop:Generator_UserColumnName="CredInt" type="xs:decimal" minOccurs="0" />
              <xs:element name="COSEC" msprop:Generator_ColumnVarNameInTable="columnCOSEC" msprop:Generator_ColumnPropNameInRow="COSEC" msprop:Generator_ColumnPropNameInTable="COSECColumn" msprop:Generator_UserColumnName="COSEC" type="xs:decimal" minOccurs="0" />
              <xs:element name="CreditoInterno" msprop:Generator_ColumnVarNameInTable="columnCreditoInterno" msprop:Generator_ColumnPropNameInRow="CreditoInterno" msprop:Generator_ColumnPropNameInTable="CreditoInternoColumn" msprop:Generator_UserColumnName="CreditoInterno" type="xs:decimal" minOccurs="0" />
              <xs:element name="CosecCliente" msprop:Generator_ColumnVarNameInTable="columnCosecCliente" msprop:Generator_ColumnPropNameInRow="CosecCliente" msprop:Generator_ColumnPropNameInTable="CosecClienteColumn" msprop:Generator_UserColumnName="CosecCliente" type="xs:decimal" minOccurs="0" />
              <xs:element name="DiasValor" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDiasValor" msprop:Generator_ColumnPropNameInRow="DiasValor" msprop:Generator_ColumnPropNameInTable="DiasValorColumn" msprop:Generator_UserColumnName="DiasValor" type="xs:decimal" minOccurs="0" />
              <xs:element name="ClienteNome" msprop:Generator_ColumnVarNameInTable="columnClienteNome" msprop:Generator_ColumnPropNameInRow="ClienteNome" msprop:Generator_ColumnPropNameInTable="ClienteNomeColumn" msprop:Generator_UserColumnName="ClienteNome" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="CodPagamento" msprop:Generator_ColumnVarNameInTable="columnCodPagamento" msprop:Generator_ColumnPropNameInRow="CodPagamento" msprop:Generator_ColumnPropNameInTable="CodPagamentoColumn" msprop:Generator_UserColumnName="CodPagamento" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="DescPagamento" msprop:Generator_ColumnVarNameInTable="columnDescPagamento" msprop:Generator_ColumnPropNameInRow="DescPagamento" msprop:Generator_ColumnPropNameInTable="DescPagamentoColumn" msprop:Generator_UserColumnName="DescPagamento" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="MDA" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnMDA" msprop:Generator_ColumnPropNameInRow="MDA" msprop:Generator_ColumnPropNameInTable="MDAColumn" msprop:Generator_UserColumnName="MDA" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//RIDebitosGLOBAL" />
      <xs:field xpath="No_" />
    </xs:unique>
    <xs:unique name="RIDebitosVendedor_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//RIDebitosVendedor" />
      <xs:field xpath="No_" />
    </xs:unique>
    <xs:unique name="Dashboard_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//Dashboard" />
      <xs:field xpath="Mes" />
    </xs:unique>
    <xs:unique name="Constraint2" msdata:PrimaryKey="true">
      <xs:selector xpath=".//RIdebitosGeral" />
      <xs:field xpath="Customer_x0020_No_" />
    </xs:unique>
  </xs:element>
</xs:schema>